|
VSF Documented
|
Functions | |
| vsf_err_t | vsf_systimer_init (void) |
| initialise SysTick to generate a system timer ! | |
| void | vsf_systick_enable (void) |
| enable ! | |
| vsf_systimer_tick_t | vsf_systimer_get (void) |
| vsf_systimer_tick_t | vsf_systimer_tick_to_us (vsf_systimer_tick_t tick) |
| void | vsf_test_trace (uint8_t level, const char *format,...) |
| void | vsf_test_run (vsf_test_t *test) |
| initialize vsf test | |
| void | vsf_test_assert (vsf_test_result_t result, const char *file_name, uint32_t line, const char *function_name, const char *condition) |
| rong jump. the user does not need to directly call this API | |
| void | vsf_test_reboot (vsf_test_result_t result, const char *file_name, uint32_t line, const char *function_name, const char *condition) |
| reboot, usually called inside an exception. | |
| void | vsf_test_hw_config (vsf_peripheral_type_t peripheral_type, const vsf_test_inst_t *inst, bool init) |
| GPIO config hook called before/after running test cases on an instance. Board override (weak): configure pinmux / GPIO for the peripheral under test. | |
| void | vsf_test_busy_wait_ms (uint32_t ms) |
| Busy-wait for approximately the given milliseconds. Useful for simple inter-step delays in test scenarios where vsf_systimer is not initialized. Calibrated by VSF_TEST_CFG_BUSY_WAIT_CYCLES_PER_MS. | |
| void | vsf_test_busy_wait_us (uint32_t us) |
| vsf_test_result_t | vsf_test_run_suite_case (const vsf_test_suite_t *suite, uint16_t local_idx, const vsf_test_inst_t *inst) |
| Run a single test case within a suite. No setup/teardown is performed — the caller is responsible for calling setup before the first case and teardown after the last case. | |
| void | vsf_test_run_suite (const vsf_test_suite_t *suite) |
| Run all cases in a suite. Calls setup before the first case and teardown after the last case. If setup returns false, all cases are skipped. | |
|
extern |
initialise SysTick to generate a system timer !
| frequency | the target tick frequency in Hz ! |
|
extern |
enable !
| void | ! |
| none |
| void | ! |
| bool |
| void | ! |
| none |
|
extern |
|
extern |
| void vsf_test_trace | ( | uint8_t | level, |
| const char * | format, | ||
| ... | |||
| ) |
| void vsf_test_run | ( | vsf_test_t * | test | ) |
initialize vsf test
| [in] | test | test instance pointer (must not be NULL) |
| void vsf_test_assert | ( | vsf_test_result_t | result, |
| const char * | file_name, | ||
| uint32_t | line, | ||
| const char * | function_name, | ||
| const char * | condition | ||
| ) |
rong jump. the user does not need to directly call this API
| [in] | result | test result, vsf_test_result_t |
| [in] | file_name | then name of the file where the assertion occurred |
| [in] | line | the line number of the code where the assertion occurred |
| [in] | function_name | the name of the function where the assertion occurred |
| [in] | condition | String of asserted code |
| void vsf_test_reboot | ( | vsf_test_result_t | result, |
| const char * | file_name, | ||
| uint32_t | line, | ||
| const char * | function_name, | ||
| const char * | additional_str | ||
| ) |
reboot, usually called inside an exception.
| [in] | result | test result, vsf_test_result_t |
| [in] | file_name | then name of the file where the assertion occurred |
| [in] | line | the line number of the code where the assertion occurred |
| [in] | function_name | the name of the function where the assertion occurred |
| [in] | additional_str | provide additional exception information |
| void vsf_test_hw_config | ( | vsf_peripheral_type_t | peripheral_type, |
| const vsf_test_inst_t * | inst, | ||
| bool | init | ||
| ) |
GPIO config hook called before/after running test cases on an instance. Board override (weak): configure pinmux / GPIO for the peripheral under test.
| [in] | peripheral_type | VSF_PERIPHERAL_TYPE_* of the instance under test |
| [in] | arg | HAL handle (or array of handles) for the instance, same as suite->arg |
| [in] | init | true before cases, false after cases (teardown) |
< Board intentionally configures all pins elsewhere (e.g. boot-time pinmux); just record that the default hook ran.
| void vsf_test_busy_wait_ms | ( | uint32_t | ms | ) |
Busy-wait for approximately the given milliseconds. Useful for simple inter-step delays in test scenarios where vsf_systimer is not initialized. Calibrated by VSF_TEST_CFG_BUSY_WAIT_CYCLES_PER_MS.
| [in] | ms | milliseconds to wait |
| void vsf_test_busy_wait_us | ( | uint32_t | us | ) |
| vsf_test_result_t vsf_test_run_suite_case | ( | const vsf_test_suite_t * | suite, |
| uint16_t | local_idx, | ||
| const vsf_test_inst_t * | inst | ||
| ) |
Run a single test case within a suite. No setup/teardown is performed — the caller is responsible for calling setup before the first case and teardown after the last case.
| [in] | suite | pointer to the suite containing the case |
| [in] | local_idx | index of the case within the suite's cases array |
| void vsf_test_run_suite | ( | const vsf_test_suite_t * | suite | ) |
Run all cases in a suite. Calls setup before the first case and teardown after the last case. If setup returns false, all cases are skipped.
| [in] | suite | pointer to the suite to run |