GPIO unit test implementation for NAVHAL. More...
#include "core/cortex-m4/gpio.h"#include "core/cortex-m4/gpio_reg.h"#include "unity.h"#include <stdint.h>
Macros | |
| #define | CORTEX_M4 |
| #define | TEST_PIN GPIO_PC09 |
| Test pin used for all GPIO tests (Port C, Pin 9) | |
| #define | TEST_AF GPIO_AF07 |
| Alternate function used for testing (AF7) | |
Functions | |
| void | test_hal_gpio_setmode (void) |
| Test GPIO mode configuration. | |
| void | test_hal_gpio_getmode (void) |
| Test GPIO mode reading. | |
| void | test_hal_gpio_digitalwrite_sets_pin_high (void) |
| Test digital write (high) operation. | |
| void | test_hal_gpio_digitalwrite_sets_pin_low (void) |
| Test digital write (low) operation. | |
| void | test_gpio_set_alternate_function (void) |
| Test alternate function configuration. | |
GPIO unit test implementation for NAVHAL.
This file implements the test cases for verifying GPIO functionality in the NAVHAL hardware abstraction layer. It tests both the high-level HAL interface and the underlying register-level configurations.
Tests cover:
| #define CORTEX_M4 |
| #define TEST_AF GPIO_AF07 |
Alternate function used for testing (AF7)
| #define TEST_PIN GPIO_PC09 |
Test pin used for all GPIO tests (Port C, Pin 9)
| void test_gpio_set_alternate_function | ( | void | ) |
Test alternate function configuration.
Verifies that hal_gpio_set_alternate_function():
Test sequence:
| void test_hal_gpio_digitalwrite_sets_pin_high | ( | void | ) |
Test digital write (high) operation.
Test digital write high.
Verifies that hal_gpio_digitalwrite() with GPIO_HIGH:
Test sequence:
| void test_hal_gpio_digitalwrite_sets_pin_low | ( | void | ) |
Test digital write (low) operation.
Test digital write low.
Verifies that hal_gpio_digitalwrite() with GPIO_LOW:
Test sequence:
| void test_hal_gpio_getmode | ( | void | ) |
Test GPIO mode reading.
Verifies that hal_gpio_getmode() correctly returns:
Test sequence:
| void test_hal_gpio_setmode | ( | void | ) |
Test GPIO mode configuration.
Verifies that hal_gpio_setmode() correctly configures:
Test sequence: