/*
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
Copyright (C) 2016..2019 Thomas Schöpping et al.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#include
#include
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_PKxxxExxx) && (AMIROLLD_CFG_PKxxxExxx == 1)) || defined(__DOXYGEN__)
/******************************************************************************/
/* LOCAL DEFINITIONS */
/******************************************************************************/
/******************************************************************************/
/* EXPORTED VARIABLES */
/******************************************************************************/
/******************************************************************************/
/* LOCAL TYPES */
/******************************************************************************/
/******************************************************************************/
/* LOCAL VARIABLES */
/******************************************************************************/
/******************************************************************************/
/* LOCAL FUNCTIONS */
/******************************************************************************/
/******************************************************************************/
/* EXPORTED FUNCTIONS */
/******************************************************************************/
aos_utresult_t utAlldPkxxxexxxFunc(BaseSequentialStream* stream, aos_unittest_t* ut)
{
aosDbgCheck(ut->data != NULL && ((ut_pkxxxexxx_t*)ut->data)->driver != NULL);
// local variables
aos_utresult_t result = {0, 0};
uint32_t status;
chprintf(stream, "checking PWM configuration...\n");
status = pkxxxexxx_lld_checkPWMconfiguration(((ut_pkxxxexxx_t*)ut->data)->driver);
if (status == APAL_STATUS_OK) {
aosUtPassed(stream, &result);
} else {
aosUtFailedMsg(stream, &result, "0x%08X\n", status);
// abort at this point
return result;
}
chprintf(stream, "buzzing for one second...\n");
status = pkxxxexxx_lld_enable(((ut_pkxxxexxx_t*)ut->data)->driver, ((ut_pkxxxexxx_t*)ut->data)->channel, true);
aosThdSSleep(1);
status |= pkxxxexxx_lld_enable(((ut_pkxxxexxx_t*)ut->data)->driver, ((ut_pkxxxexxx_t*)ut->data)->channel, false);
if (status == APAL_STATUS_OK) {
aosUtPassed(stream, &result);
} else {
aosUtFailedMsg(stream, &result, "0x%08X\n", status);
}
return result;
}
#endif /* AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_PKxxxExxx) && (AMIROLLD_CFG_PKxxxExxx == 1) */