Revision 3940ba8a
| amiroos.h | ||
|---|---|---|
| 54 | 54 |
|
| 55 | 55 |
/** @} */ |
| 56 | 56 |
|
| 57 |
/* subsystems headers */ |
|
| 58 |
#include <aosconf.h> |
|
| 57 |
/******************************************************************************/ |
|
| 58 |
/* SUBSYSTEMS */ |
|
| 59 |
/******************************************************************************/ |
|
| 60 |
|
|
| 61 |
/* Bootloader (AMiRo-BLT) */ |
|
| 62 |
#include <amiroblt.h> |
|
| 63 |
|
|
| 64 |
/* System Kerne (ChibiOS)l */ |
|
| 59 | 65 |
#include <hal.h> |
| 60 | 66 |
#include <ch.h> |
| 61 |
#include <amiroblt.h> |
|
| 67 |
|
|
| 68 |
/* Low-Level Drivers (AMiRo-LLD) */ |
|
| 62 | 69 |
#include <amiro-lld.h> |
| 63 | 70 |
|
| 64 |
/* configuration check */ |
|
| 71 |
/******************************************************************************/ |
|
| 72 |
/* AMiRo-OS CORE */ |
|
| 73 |
/******************************************************************************/ |
|
| 74 |
|
|
| 75 |
/* configuration */ |
|
| 76 |
#include <aosconf.h> |
|
| 65 | 77 |
#if !defined(_AMIRO_OS_CFG_) |
| 66 | 78 |
#error "invalid AMiRo-OS configuration file" |
| 67 |
#endif |
|
| 68 |
#if (_AMIRO_OS_CFG_VERSION_MAJOR_ != AMIROOS_VERSION_MAJOR) || (_AMIRO_OS_CFG_VERSION_MINOR_ < AMIROOS_VERSION_MINOR) |
|
| 79 |
#elif (AMIRO_OS_CFG_VERSION_MAJOR != AMIROOS_VERSION_MAJOR) || (AMIRO_OS_CFG_VERSION_MINOR < AMIROOS_VERSION_MINOR) |
|
| 69 | 80 |
#error "incompatible AMiRo-OS configuration file" |
| 70 | 81 |
#endif |
| 71 | 82 |
#include "core/inc/aos_confcheck.h" |
| 72 | 83 |
|
| 73 | 84 |
/* core headers */ |
| 85 |
#include "core/inc/aos_types.h" |
|
| 74 | 86 |
#include "core/inc/aos_debug.h" |
| 87 |
#include "core/inc/aos_time.h" |
|
| 88 |
#include "core/inc/aos_timer.h" |
|
| 75 | 89 |
#include "core/inc/aos_iostream.h" |
| 76 | 90 |
#include "core/inc/aos_shell.h" |
| 77 | 91 |
#include "core/inc/aos_system.h" |
| 78 | 92 |
#include "core/inc/aos_thread.h" |
| 79 |
#include "core/inc/aos_time.h" |
|
| 80 |
#include "core/inc/aos_timer.h" |
|
| 81 |
#include "core/inc/aos_types.h" |
|
| 82 | 93 |
#include "core/inc/aos_unittest.h" |
| 83 | 94 |
|
| 95 |
/* module specifications */ |
|
| 96 |
#include <module.h> |
|
| 97 |
|
|
| 84 | 98 |
#endif /* AMIROOS_H */ |
| core/inc/aos_confcheck.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_CONFCHECK_H |
| 28 | 28 |
#define AMIROOS_CONFCHECK_H |
| 29 | 29 |
|
| 30 |
#include <aosconf.h>
|
|
| 30 |
#include <amiroos.h>
|
|
| 31 | 31 |
|
| 32 | 32 |
/******************************************************************************/ |
| 33 | 33 |
/* CONSTANTS */ |
| core/inc/aos_debug.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_DEBUG_H |
| 28 | 28 |
#define AMIROOS_DEBUG_H |
| 29 | 29 |
|
| 30 |
#include <aosconf.h> |
|
| 31 |
#include <hal.h> |
|
| 32 |
#include <chprintf.h> |
|
| 30 |
#include <amiroos.h> |
|
| 31 |
|
|
| 33 | 32 |
/******************************************************************************/ |
| 34 | 33 |
/* CONSTANTS */ |
| 35 | 34 |
/******************************************************************************/ |
| core/inc/aos_iostream.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_IOSTREAM_H |
| 28 | 28 |
#define AMIROOS_IOSTREAM_H |
| 29 | 29 |
|
| 30 |
#include <hal.h> |
|
| 31 |
#include <aos_types.h> |
|
| 32 |
#include <stdarg.h> |
|
| 33 |
|
|
| 30 |
#include <amiroos.h> |
|
| 34 | 31 |
|
| 35 | 32 |
/******************************************************************************/ |
| 36 | 33 |
/* CONSTANTS */ |
| core/inc/aos_shell.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_SHELL_H |
| 28 | 28 |
#define AMIROOS_SHELL_H |
| 29 | 29 |
|
| 30 |
#include <aosconf.h> |
|
| 30 |
#include <amiroos.h> |
|
| 31 |
|
|
| 31 | 32 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) |
| 32 |
#include <hal.h> |
|
| 33 |
#include <aos_types.h> |
|
| 34 |
#include <aos_debug.h> |
|
| 33 |
|
|
| 35 | 34 |
/******************************************************************************/ |
| 36 | 35 |
/* CONSTANTS */ |
| 37 | 36 |
/******************************************************************************/ |
| core/inc/aos_system.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_SYSTEM_H |
| 28 | 28 |
#define AMIROOS_SYSTEM_H |
| 29 | 29 |
|
| 30 |
#include <time.h> |
|
| 31 |
#include <aos_iostream.h> |
|
| 32 |
#include <amiro-lld.h> |
|
| 33 |
#include <aos_shell.h> |
|
| 34 |
#include <aos_time.h> |
|
| 30 |
#include <amiroos.h> |
|
| 35 | 31 |
#include <chprintf.h> |
| 36 | 32 |
|
| 37 | 33 |
/******************************************************************************/ |
| core/inc/aos_thread.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_THREAD_H |
| 28 | 28 |
#define AMIROOS_THREAD_H |
| 29 | 29 |
|
| 30 |
#include <aos_time.h>
|
|
| 31 |
#include <aos_system.h> |
|
| 30 |
#include <amiroos.h>
|
|
| 31 |
|
|
| 32 | 32 |
/******************************************************************************/ |
| 33 | 33 |
/* CONSTANTS */ |
| 34 | 34 |
/******************************************************************************/ |
| core/inc/aos_time.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_TIME_H |
| 28 | 28 |
#define AMIROOS_TIME_H |
| 29 | 29 |
|
| 30 |
#include <stdint.h>
|
|
| 30 |
#include <amiroos.h>
|
|
| 31 | 31 |
|
| 32 | 32 |
/******************************************************************************/ |
| 33 | 33 |
/* CONSTANTS */ |
| core/inc/aos_timer.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_TIMER_H |
| 28 | 28 |
#define AMIROOS_TIMER_H |
| 29 | 29 |
|
| 30 |
#include <ch.h>
|
|
| 31 |
#include <aos_time.h> |
|
| 30 |
#include <amiroos.h>
|
|
| 31 |
|
|
| 32 | 32 |
/******************************************************************************/ |
| 33 | 33 |
/* CONSTANTS */ |
| 34 | 34 |
/******************************************************************************/ |
| core/inc/aos_types.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_TYPES_H |
| 28 | 28 |
#define AMIROOS_TYPES_H |
| 29 | 29 |
|
| 30 |
#include <ch.h>
|
|
| 30 |
#include <amiroos.h>
|
|
| 31 | 31 |
|
| 32 | 32 |
/******************************************************************************/ |
| 33 | 33 |
/* CONSTANTS */ |
| core/inc/aos_unittest.h | ||
|---|---|---|
| 27 | 27 |
#ifndef AMIROOS_UNITTEST_H |
| 28 | 28 |
#define AMIROOS_UNITTEST_H |
| 29 | 29 |
|
| 30 |
#include <aosconf.h> |
|
| 30 |
#include <amiroos.h> |
|
| 31 |
|
|
| 31 | 32 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
| 32 |
#include <hal.h> |
|
| 33 |
#include <aos_shell.h> |
|
| 33 |
|
|
| 34 | 34 |
/******************************************************************************/ |
| 35 | 35 |
/* CONSTANTS */ |
| 36 | 36 |
/******************************************************************************/ |
| core/src/aos_iostream.c | ||
|---|---|---|
| 25 | 25 |
* @{
|
| 26 | 26 |
*/ |
| 27 | 27 |
|
| 28 |
#include <aos_iostream.h>
|
|
| 28 |
#include <amiroos.h>
|
|
| 29 | 29 |
|
| 30 | 30 |
/******************************************************************************/ |
| 31 | 31 |
/* LOCAL DEFINITIONS */ |
| core/src/aos_main.cpp | ||
|---|---|---|
| 26 | 26 |
* @{
|
| 27 | 27 |
*/ |
| 28 | 28 |
|
| 29 |
#include <aos_system.h> |
|
| 30 |
#include <module.h> |
|
| 29 |
#include <amiroos.h> |
|
| 31 | 30 |
|
| 32 | 31 |
/* |
| 33 | 32 |
* hook to add further includes |
| core/src/aos_shell.c | ||
|---|---|---|
| 25 | 25 |
* @{
|
| 26 | 26 |
*/ |
| 27 | 27 |
|
| 28 |
#include <aos_shell.h> |
|
| 28 |
#include <amiroos.h> |
|
| 29 |
#include <string.h> |
|
| 29 | 30 |
|
| 30 | 31 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) |
| 31 |
#include <aos_debug.h> |
|
| 32 |
#include <aos_time.h> |
|
| 33 |
#include <aos_system.h> |
|
| 34 |
#include <string.h> |
|
| 32 |
|
|
| 35 | 33 |
/******************************************************************************/ |
| 36 | 34 |
/* LOCAL DEFINITIONS */ |
| 37 | 35 |
/******************************************************************************/ |
| core/src/aos_system.c | ||
|---|---|---|
| 26 | 26 |
* @{
|
| 27 | 27 |
*/ |
| 28 | 28 |
|
| 29 |
#include <aos_system.h> |
|
| 30 |
|
|
| 31 |
#include <amiroblt.h> |
|
| 32 |
#include <module.h> |
|
| 29 |
#include <amiroos.h> |
|
| 30 |
#include <stdarg.h> |
|
| 33 | 31 |
#include <string.h> |
| 34 | 32 |
#include <stdlib.h> |
| 33 |
|
|
| 35 | 34 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) |
| 36 | 35 |
#include <ch_test.h> |
| 37 | 36 |
#include <rt_test_root.h> |
| core/src/aos_thread.c | ||
|---|---|---|
| 24 | 24 |
* @{
|
| 25 | 25 |
*/ |
| 26 | 26 |
|
| 27 |
#include <aos_thread.h> |
|
| 27 |
#include <amiroos.h> |
|
| 28 |
|
|
| 28 | 29 |
/******************************************************************************/ |
| 29 | 30 |
/* LOCAL DEFINITIONS */ |
| 30 | 31 |
/******************************************************************************/ |
| core/src/aos_time.c | ||
|---|---|---|
| 24 | 24 |
* @{
|
| 25 | 25 |
*/ |
| 26 | 26 |
|
| 27 |
#include <aos_time.h>
|
|
| 27 |
#include <amiroos.h>
|
|
| 28 | 28 |
|
| 29 | 29 |
/******************************************************************************/ |
| 30 | 30 |
/* LOCAL DEFINITIONS */ |
| ... | ... | |
| 49 | 49 |
/******************************************************************************/ |
| 50 | 50 |
/* EXPORTED FUNCTIONS */ |
| 51 | 51 |
/******************************************************************************/ |
| 52 |
#include <aos_debug.h> |
|
| 53 |
#include <aos_system.h> |
|
| 54 | 52 |
|
| 55 | 53 |
/** |
| 56 | 54 |
* @brief Calculates the day of week from a specified date. |
| core/src/aos_timer.c | ||
|---|---|---|
| 25 | 25 |
* @{
|
| 26 | 26 |
*/ |
| 27 | 27 |
|
| 28 |
#include <aos_timer.h>
|
|
| 28 |
#include <amiroos.h>
|
|
| 29 | 29 |
|
| 30 | 30 |
/******************************************************************************/ |
| 31 | 31 |
/* LOCAL DEFINITIONS */ |
| ... | ... | |
| 46 | 46 |
/******************************************************************************/ |
| 47 | 47 |
/* LOCAL FUNCTIONS */ |
| 48 | 48 |
/******************************************************************************/ |
| 49 |
#include <aos_system.h> |
|
| 50 | 49 |
|
| 51 | 50 |
/* |
| 52 | 51 |
* forward declarations |
| core/src/aos_unittest.c | ||
|---|---|---|
| 26 | 26 |
* @{
|
| 27 | 27 |
*/ |
| 28 | 28 |
|
| 29 |
#include <aos_unittest.h> |
|
| 29 |
#include <amiroos.h> |
|
| 30 |
#include <string.h> |
|
| 30 | 31 |
|
| 31 | 32 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
| 32 |
#include <aos_debug.h> |
|
| 33 |
#include <chprintf.h> |
|
| 34 |
#include <string.h> |
|
| 33 |
|
|
| 35 | 34 |
/******************************************************************************/ |
| 36 | 35 |
/* LOCAL DEFINITIONS */ |
| 37 | 36 |
/******************************************************************************/ |
| modules/DiWheelDrive_1-1/module.c | ||
|---|---|---|
| 434 | 434 |
/*===========================================================================*/ |
| 435 | 435 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
| 436 | 436 |
#include <string.h> |
| 437 |
#include <chprintf.h> |
|
| 438 | 437 |
|
| 439 | 438 |
/* |
| 440 | 439 |
* A3906 (motor driver) |
| modules/LightRing_1-0/module.c | ||
|---|---|---|
| 26 | 26 |
|
| 27 | 27 |
#include "module.h" |
| 28 | 28 |
|
| 29 |
#include <amiroos.h> |
|
| 30 |
|
|
| 31 | 29 |
/*===========================================================================*/ |
| 32 | 30 |
/** |
| 33 | 31 |
* @name Module specific functions |
| ... | ... | |
| 361 | 359 |
#endif /* AMIROOS_CFG_TESTS_ENABLE == true */ |
| 362 | 360 |
|
| 363 | 361 |
/** @} */ |
| 362 |
/** @} */ |
|
| modules/PowerManagement_1-1/module.c | ||
|---|---|---|
| 26 | 26 |
|
| 27 | 27 |
#include "module.h" |
| 28 | 28 |
|
| 29 |
#include <amiroos.h> |
|
| 30 |
|
|
| 31 | 29 |
/*===========================================================================*/ |
| 32 | 30 |
/** |
| 33 | 31 |
* @name Module specific functions |
| modules/aos_chconf.h | ||
|---|---|---|
| 31 | 31 |
|
| 32 | 32 |
#define _CHIBIOS_RT_CONF_ |
| 33 | 33 |
|
| 34 |
#include <aosconf.h> |
|
| 35 |
|
|
| 36 | 34 |
/*===========================================================================*/ |
| 37 | 35 |
/** |
| 38 | 36 |
* @name System timers settings |
| periphery-lld/periphAL.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_PERIPHAL_H |
| 20 | 20 |
#define AMIROOS_PERIPHAL_H |
| 21 | 21 |
|
| 22 |
#include <amiro-lld.h> |
|
| 23 |
|
|
| 22 | 24 |
/*============================================================================*/ |
| 23 | 25 |
/* VERSION */ |
| 24 | 26 |
/*============================================================================*/ |
| ... | ... | |
| 39 | 41 |
/* DEPENDENCIES */ |
| 40 | 42 |
/*============================================================================*/ |
| 41 | 43 |
|
| 42 |
#include <periphALtypes.h> |
|
| 43 | 44 |
#include <hal.h> |
| 44 |
#include <aos_debug.h> |
|
| 45 | 45 |
|
| 46 | 46 |
/*============================================================================*/ |
| 47 | 47 |
/* GENERAL */ |
| ... | ... | |
| 55 | 55 |
static inline void usleep(apalTime_t us) |
| 56 | 56 |
{
|
| 57 | 57 |
// check if the specified time can be represented by the system |
| 58 |
aosDbgCheck(us <= chTimeI2US(TIME_INFINITE));
|
|
| 58 |
chDbgCheck(us <= chTimeI2US(TIME_INFINITE));
|
|
| 59 | 59 |
|
| 60 |
const sysinterval_t si = chTimeUS2I(us);
|
|
| 60 |
const sysinterval_t interval = chTimeUS2I(us);
|
|
| 61 | 61 |
// TIME_IMMEDIATE makes no sense and would even cause system halt |
| 62 |
if (si != TIME_IMMEDIATE) {
|
|
| 63 |
chThdSleep(si);
|
|
| 62 |
if (interval != TIME_IMMEDIATE) {
|
|
| 63 |
chThdSleep(interval);
|
|
| 64 | 64 |
} |
| 65 | 65 |
return; |
| 66 | 66 |
} |
| ... | ... | |
| 89 | 89 |
*/ |
| 90 | 90 |
static inline apalExitStatus_t apalGpioRead(apalGpio_t* gpio, apalGpioState_t* const val) |
| 91 | 91 |
{
|
| 92 |
aosDbgCheck(gpio != NULL);
|
|
| 93 |
aosDbgCheck(val != NULL);
|
|
| 92 |
chDbgCheck(gpio != NULL);
|
|
| 93 |
chDbgCheck(val != NULL);
|
|
| 94 | 94 |
|
| 95 | 95 |
*val = (palReadPad(gpio->port, gpio->pad) == PAL_HIGH) ? APAL_GPIO_HIGH : APAL_GPIO_LOW; |
| 96 | 96 |
return APAL_STATUS_OK; |
| ... | ... | |
| 106 | 106 |
*/ |
| 107 | 107 |
static inline apalExitStatus_t apalGpioWrite(apalGpio_t* gpio, const apalGpioState_t val) |
| 108 | 108 |
{
|
| 109 |
aosDbgCheck(gpio != NULL);
|
|
| 109 |
chDbgCheck(gpio != NULL);
|
|
| 110 | 110 |
|
| 111 | 111 |
// palWritePad() is not guaranteed to be atomic, thus the scheduler is locked. |
| 112 | 112 |
syssts_t sysstatus = chSysGetStatusAndLockX(); |
| ... | ... | |
| 124 | 124 |
*/ |
| 125 | 125 |
static inline apalExitStatus_t apalGpioToggle(apalGpio_t* gpio) |
| 126 | 126 |
{
|
| 127 |
aosDbgCheck(gpio != NULL);
|
|
| 127 |
chDbgCheck(gpio != NULL);
|
|
| 128 | 128 |
|
| 129 | 129 |
// palWritePad() is not guaranteed to be atomic, thus the scheduler is locked. |
| 130 | 130 |
syssts_t sysstatus = chSysGetStatusAndLockX(); |
| ... | ... | |
| 143 | 143 |
*/ |
| 144 | 144 |
static inline apalExitStatus_t apalControlGpioGet(const apalControlGpio_t* const cgpio, apalControlGpioState_t* const val) |
| 145 | 145 |
{
|
| 146 |
aosDbgCheck(cgpio != NULL);
|
|
| 147 |
aosDbgCheck(cgpio->gpio != NULL);
|
|
| 148 |
aosDbgCheck(val != NULL);
|
|
| 146 |
chDbgCheck(cgpio != NULL);
|
|
| 147 |
chDbgCheck(cgpio->gpio != NULL);
|
|
| 148 |
chDbgCheck(val != NULL);
|
|
| 149 | 149 |
|
| 150 | 150 |
*val = ((palReadPad(cgpio->gpio->port, cgpio->gpio->pad) == PAL_HIGH) ^ (cgpio->meta.active == APAL_GPIO_ACTIVE_HIGH)) ? APAL_GPIO_OFF : APAL_GPIO_ON; |
| 151 | 151 |
return APAL_STATUS_OK; |
| ... | ... | |
| 161 | 161 |
*/ |
| 162 | 162 |
static inline apalExitStatus_t apalControlGpioSet(const apalControlGpio_t* const cgpio, const apalControlGpioState_t val) |
| 163 | 163 |
{
|
| 164 |
aosDbgCheck(cgpio != NULL);
|
|
| 165 |
aosDbgCheck(cgpio->gpio != NULL);
|
|
| 166 |
aosDbgCheck(cgpio->meta.direction == APAL_GPIO_DIRECTION_OUTPUT || cgpio->meta.direction == APAL_GPIO_DIRECTION_BIDIRECTIONAL);
|
|
| 164 |
chDbgCheck(cgpio != NULL);
|
|
| 165 |
chDbgCheck(cgpio->gpio != NULL);
|
|
| 166 |
chDbgCheck(cgpio->meta.direction == APAL_GPIO_DIRECTION_OUTPUT || cgpio->meta.direction == APAL_GPIO_DIRECTION_BIDIRECTIONAL);
|
|
| 167 | 167 |
|
| 168 | 168 |
// palWritePad() is not guaranteed to be atomic, thus the scheduler is locked. |
| 169 | 169 |
syssts_t sysstatus = chSysGetStatusAndLockX(); |
| ... | ... | |
| 204 | 204 |
*/ |
| 205 | 205 |
static inline apalExitStatus_t apalPWMSet(apalPWMDriver_t* pwm, const apalPWMchannel_t channel, const apalPWMwidth_t width) |
| 206 | 206 |
{
|
| 207 |
aosDbgCheck(pwm != NULL);
|
|
| 207 |
chDbgCheck(pwm != NULL);
|
|
| 208 | 208 |
|
| 209 | 209 |
pwmEnableChannel(pwm, (pwmchannel_t)channel, pwm->period * ((float)width / (float)APAL_PWM_WIDTH_MAX) + 0.5f); |
| 210 | 210 |
return APAL_STATUS_OK; |
| ... | ... | |
| 220 | 220 |
*/ |
| 221 | 221 |
static inline apalExitStatus_t apalPWMGetFrequency(apalPWMDriver_t* pwm, apalPWMfrequency_t* const frequency) |
| 222 | 222 |
{
|
| 223 |
aosDbgCheck(pwm != NULL);
|
|
| 224 |
aosDbgCheck(frequency != NULL);
|
|
| 223 |
chDbgCheck(pwm != NULL);
|
|
| 224 |
chDbgCheck(frequency != NULL);
|
|
| 225 | 225 |
|
| 226 | 226 |
*frequency = pwm->config->frequency; |
| 227 | 227 |
return APAL_STATUS_OK; |
| ... | ... | |
| 237 | 237 |
*/ |
| 238 | 238 |
static inline apalExitStatus_t apalPWMGetPeriod(apalPWMDriver_t* pwm, apalPWMperiod_t* const period) |
| 239 | 239 |
{
|
| 240 |
aosDbgCheck(pwm != NULL);
|
|
| 241 |
aosDbgCheck(period != NULL);
|
|
| 240 |
chDbgCheck(pwm != NULL);
|
|
| 241 |
chDbgCheck(period != NULL);
|
|
| 242 | 242 |
|
| 243 | 243 |
*period = pwm->period; |
| 244 | 244 |
return APAL_STATUS_OK; |
| ... | ... | |
| 267 | 267 |
*/ |
| 268 | 268 |
static inline apalExitStatus_t apalQEIGetDirection(apalQEIDriver_t* qei, apalQEIDirection_t* const direction) |
| 269 | 269 |
{
|
| 270 |
aosDbgCheck(qei != NULL);
|
|
| 271 |
aosDbgCheck(direction != NULL);
|
|
| 270 |
chDbgCheck(qei != NULL);
|
|
| 271 |
chDbgCheck(direction != NULL);
|
|
| 272 | 272 |
|
| 273 | 273 |
*direction = (qei_lld_get_direction(qei)) ? APAL_QEI_DIRECTION_DOWN : APAL_QEI_DIRECTION_UP; |
| 274 | 274 |
|
| ... | ... | |
| 285 | 285 |
*/ |
| 286 | 286 |
static inline apalExitStatus_t apalQEIGetPosition(apalQEIDriver_t* qei, apalQEICount_t* const position) |
| 287 | 287 |
{
|
| 288 |
aosDbgCheck(qei != NULL);
|
|
| 289 |
aosDbgCheck(position != NULL);
|
|
| 288 |
chDbgCheck(qei != NULL);
|
|
| 289 |
chDbgCheck(position != NULL);
|
|
| 290 | 290 |
|
| 291 | 291 |
*position = qei_lld_get_position(qei); |
| 292 | 292 |
|
| ... | ... | |
| 303 | 303 |
*/ |
| 304 | 304 |
static inline apalExitStatus_t apalQEIGetRange(apalQEIDriver_t* qei, apalQEICount_t* const range) |
| 305 | 305 |
{
|
| 306 |
aosDbgCheck(qei != NULL);
|
|
| 307 |
aosDbgCheck(range != NULL);
|
|
| 306 |
chDbgCheck(qei != NULL);
|
|
| 307 |
chDbgCheck(range != NULL);
|
|
| 308 | 308 |
|
| 309 | 309 |
*range = qei_lld_get_range(qei); |
| 310 | 310 |
|
| ... | ... | |
| 339 | 339 |
*/ |
| 340 | 340 |
static inline apalExitStatus_t apalI2CMasterTransmit(apalI2CDriver_t* i2cd, const apalI2Caddr_t addr, const uint8_t* const txbuf, const size_t txbytes, uint8_t* const rxbuf, const size_t rxbytes, const apalTime_t timeout) |
| 341 | 341 |
{
|
| 342 |
aosDbgCheck(i2cd != NULL);
|
|
| 342 |
chDbgCheck(i2cd != NULL);
|
|
| 343 | 343 |
|
| 344 | 344 |
#if (I2C_USE_MUTUAL_EXCLUSION == TRUE) |
| 345 | 345 |
// check whether the I2C driver was locked externally |
| ... | ... | |
| 401 | 401 |
*/ |
| 402 | 402 |
static inline apalExitStatus_t apalI2CMasterReceive(apalI2CDriver_t* i2cd, const apalI2Caddr_t addr, uint8_t* const rxbuf, const size_t rxbytes, const apalTime_t timeout) |
| 403 | 403 |
{
|
| 404 |
aosDbgCheck(i2cd != NULL);
|
|
| 404 |
chDbgCheck(i2cd != NULL);
|
|
| 405 | 405 |
|
| 406 | 406 |
#if (I2C_USE_MUTUAL_EXCLUSION == TRUE) |
| 407 | 407 |
// check whether the I2C driver was locked externally |
| ... | ... | |
| 475 | 475 |
*/ |
| 476 | 476 |
static inline apalExitStatus_t apalSPIExchange(apalSPIDriver_t* spid, const uint8_t* const txData , uint8_t* const rxData, const size_t length) |
| 477 | 477 |
{
|
| 478 |
aosDbgCheck(spid != NULL);
|
|
| 478 |
chDbgCheck(spid != NULL);
|
|
| 479 | 479 |
|
| 480 | 480 |
#if (SPI_USE_MUTUAL_EXCLUSION) |
| 481 | 481 |
// check whether the SPI driver was locked externally |
| ... | ... | |
| 509 | 509 |
*/ |
| 510 | 510 |
static inline apalExitStatus_t apalSPIReceive(apalSPIDriver_t* spid, uint8_t* const data, const size_t length) |
| 511 | 511 |
{
|
| 512 |
aosDbgCheck(spid != NULL);
|
|
| 512 |
chDbgCheck(spid != NULL);
|
|
| 513 | 513 |
|
| 514 | 514 |
#if (SPI_USE_MUTUAL_EXCLUSION) |
| 515 | 515 |
// check whether the SPI driver was locked externally |
| ... | ... | |
| 543 | 543 |
*/ |
| 544 | 544 |
static inline apalExitStatus_t apalSPITransmit(apalSPIDriver_t* spid, const uint8_t* const data, const size_t length) |
| 545 | 545 |
{
|
| 546 |
aosDbgCheck(spid != NULL);
|
|
| 546 |
chDbgCheck(spid != NULL);
|
|
| 547 | 547 |
|
| 548 | 548 |
#if (SPI_USE_MUTUAL_EXCLUSION) |
| 549 | 549 |
// check whether the SPI driver was locked externally |
| ... | ... | |
| 579 | 579 |
*/ |
| 580 | 580 |
static inline apalExitStatus_t apalSPITransmitAndReceive(apalSPIDriver_t* spid, const uint8_t* const txData , uint8_t* const rxData, const size_t txLength, const size_t rxLength) |
| 581 | 581 |
{
|
| 582 |
aosDbgCheck(spid != NULL);
|
|
| 582 |
chDbgCheck(spid != NULL);
|
|
| 583 | 583 |
|
| 584 | 584 |
#if (SPI_USE_MUTUAL_EXCLUSION) |
| 585 | 585 |
// check whether the SPI driver was locked externally |
| ... | ... | |
| 614 | 614 |
* |
| 615 | 615 |
* @param[in] c The condition to check. |
| 616 | 616 |
*/ |
| 617 |
#define apalDbgAssert(c) aosDbgAssert(c)
|
|
| 617 |
#define apalDbgAssert(c) chDbgAssert(c, "")
|
|
| 618 | 618 |
|
| 619 | 619 |
|
| 620 | 620 |
/** |
| unittests/lld/inc/ut_lld_adc.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_LLD_ADC_H |
| 20 | 20 |
#define AMIROOS_UT_LLD_ADC_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
|
|
| 24 | 22 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && (HAL_USE_ADC == TRUE))|| defined(__DOXYGEN__) |
| 25 | 23 |
|
| 26 | 24 |
/******************************************************************************/ |
| unittests/lld/src/ut_lld_adc.c | ||
|---|---|---|
| 16 | 16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 |
#include <amiroos.h> |
|
| 19 | 20 |
#include <ut_lld_adc.h> |
| 20 | 21 |
|
| 21 | 22 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && (HAL_USE_ADC == TRUE))|| defined(__DOXYGEN__) |
| ... | ... | |
| 23 | 24 |
/******************************************************************************/ |
| 24 | 25 |
/* LOCAL DEFINITIONS */ |
| 25 | 26 |
/******************************************************************************/ |
| 26 |
#include <aos_debug.h> |
|
| 27 |
#include <aos_thread.h> |
|
| 28 |
#include <chprintf.h> |
|
| 29 | 27 |
|
| 30 | 28 |
/** |
| 31 | 29 |
* @brief Event mask of the ADC analog watchdog event. |
| unittests/periphery-lld/inc/ut_alld_a3906.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_A3906_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_A3906_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_A3906)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_at24c01bn-sh-b.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_AT24C01BN_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_AT24C01BN_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_AT24C01BN)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_at42qt1050.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_AT42QT1050_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_AT42QT1050_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_AT42QT1050)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_bq24103a.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_BQ24103A_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_BQ24103A_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_BQ24103A)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_bq27500.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_BQ27500_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_BQ27500_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_BQ27500)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_bq27500_bq24103a.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_BQ27500_BQ24193A_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_BQ27500_BQ24193A_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_BQ27500) && defined(AMIROLLD_CFG_USE_BQ24103A)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_dw1000.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_DW1000_LLD_H |
| 20 | 20 |
#define AMIROOS_UT_DW1000_LLD_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_DW1000)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_hmc5883l.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_HMC5883L_LLD_H |
| 20 | 20 |
#define AMIROOS_UT_HMC5883L_LLD_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_HMC5883L)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_ina219.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_INA219_LLD_H |
| 20 | 20 |
#define AMIROOS_UT_INA219_LLD_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_INA219)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_l3g4200d.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_L3G4200D_LLD_H |
| 20 | 20 |
#define AMIROOS_UT_L3G4200D_LLD_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_L3G4200D)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_led.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_LED_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_LED_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_LED)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_lis331dlh.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_LIS331DLH_LLD_H |
| 20 | 20 |
#define AMIROOS_UT_LIS331DLH_LLD_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_LIS331DLH)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_ltc4412.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_LTC4412_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_LTC4412_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_LTC4412)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_mpr121.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_MPR121_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_MPR121_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_MPR121)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_mpu6050.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_MPU6050_LLD_HPP |
| 20 | 20 |
#define AMIROOS_UT_MPU6050_LLD_HPP |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_MPU6050)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_pca9544a.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_PCA9544A_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_PCA9544A_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_PCA9544A)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_pcal6524.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_PCAL6524_LLD_H |
| 20 | 20 |
#define AMIROOS_UT_PCAL6524_LLD_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_PCAL6524)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_pklcs1212e4001.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_PKLCS1212E4001_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_PKLCS1212E4001_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_PKLCS1212E4001)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_tlc5947.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_TLC5947_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_TLC5947_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_TLC5947)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_tps2051bdbv.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_TPS2051BDBV_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_TPS2051BDBV_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_TPS2051BDBV)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_tps62113.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_TPS62113_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_TPS62113_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_TPS62113)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/inc/ut_alld_tps62113_ina219.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_ALLD_TPS62113_INA219_H |
| 20 | 20 |
#define AMIROOS_UT_ALLD_TPS62113_INA219_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h>
|
|
| 23 |
#include <amiro-lld.h>
|
|
| 22 |
#include <amiroos.h>
|
|
| 23 |
#include <alld_tps62113.h>
|
|
| 24 | 24 |
|
| 25 | 25 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_TPS62113) && defined(AMIROLLD_CFG_USE_INA219)) || defined(__DOXYGEN__) |
| 26 | 26 |
|
| 27 |
#include <alld_tps62113.h> |
|
| 28 | 27 |
#include <alld_ina219.h> |
| 29 | 28 |
|
| 30 | 29 |
/******************************************************************************/ |
| unittests/periphery-lld/inc/ut_alld_vcnl4020.h | ||
|---|---|---|
| 19 | 19 |
#ifndef AMIROOS_UT_VCNL4020_LLD_H |
| 20 | 20 |
#define AMIROOS_UT_VCNL4020_LLD_H |
| 21 | 21 |
|
| 22 |
#include <aos_unittest.h> |
|
| 23 |
#include <amiro-lld.h> |
|
| 22 |
#include <amiroos.h> |
|
| 24 | 23 |
|
| 25 | 24 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_VCNL4020)) || defined(__DOXYGEN__) |
| 26 | 25 |
|
| unittests/periphery-lld/src/ut_alld_a3906.c | ||
|---|---|---|
| 20 | 20 |
|
| 21 | 21 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_A3906)) || defined(__DOXYGEN__) |
| 22 | 22 |
|
| 23 |
#include <aos_debug.h> |
|
| 24 |
#include <chprintf.h> |
|
| 25 |
#include <alld_a3906.h> |
|
| 26 |
#include <aos_thread.h> |
|
| 27 | 23 |
#include <stdlib.h> |
| 28 | 24 |
#include <math.h> |
| 29 | 25 |
|
| unittests/periphery-lld/src/ut_alld_at24c01bn-sh-b.c | ||
|---|---|---|
| 23 | 23 |
/******************************************************************************/ |
| 24 | 24 |
/* LOCAL DEFINITIONS */ |
| 25 | 25 |
/******************************************************************************/ |
| 26 |
#include <aos_debug.h> |
|
| 27 |
#include <chprintf.h> |
|
| 28 | 26 |
|
| 29 | 27 |
/** |
| 30 | 28 |
* @brief EEPROM address for page write/read access. |
| unittests/periphery-lld/src/ut_alld_at42qt1050.c | ||
|---|---|---|
| 23 | 23 |
/******************************************************************************/ |
| 24 | 24 |
/* LOCAL DEFINITIONS */ |
| 25 | 25 |
/******************************************************************************/ |
| 26 |
#include <aos_debug.h> |
|
| 27 |
#include <chprintf.h> |
|
| 28 |
#include <aos_thread.h> |
|
| 29 |
#include <amiroos.h> |
|
| 30 | 26 |
|
| 31 | 27 |
#define INTERRUPT_EVENT_ID 1 |
| 32 | 28 |
|
| unittests/periphery-lld/src/ut_alld_bq24103a.c | ||
|---|---|---|
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 | 46 |
|
| 47 |
#include <aos_debug.h> |
|
| 48 |
#include <chprintf.h> |
|
| 49 |
#include <aos_thread.h> |
|
| 50 |
#include <alld_bq24103a.h> |
|
| 51 | 47 |
|
| 52 | 48 |
aos_utresult_t utAlldBq24103aFunc(BaseSequentialStream* stream, aos_unittest_t* ut) |
| 53 | 49 |
{
|
| unittests/periphery-lld/src/ut_alld_bq27500.c | ||
|---|---|---|
| 25 | 25 |
/******************************************************************************/ |
| 26 | 26 |
/* LOCAL DEFINITIONS */ |
| 27 | 27 |
/******************************************************************************/ |
| 28 |
#include <aos_debug.h> |
|
| 29 |
#include <chprintf.h> |
|
| 30 |
#include <aos_thread.h> |
|
| 31 |
#include <alld_bq27500.h> |
|
| 32 | 28 |
|
| 33 | 29 |
// change saved unseal keys to test bruteforcing |
| 34 | 30 |
#ifdef BQ27500_UT_TEST_BRUTEFORCE |
| unittests/periphery-lld/src/ut_alld_bq27500_bq24103a.c | ||
|---|---|---|
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 | 46 |
|
| 47 |
#include <aos_debug.h> |
|
| 48 |
#include <chprintf.h> |
|
| 49 |
#include <aos_thread.h> |
|
| 50 | 47 |
|
| 51 | 48 |
aos_utresult_t utAlldBq27500Bq24103aFunc(BaseSequentialStream *stream, aos_unittest_t *ut) |
| 52 | 49 |
{
|
| unittests/periphery-lld/src/ut_alld_dw1000.c | ||
|---|---|---|
| 23 | 23 |
/******************************************************************************/ |
| 24 | 24 |
/* LOCAL DEFINITIONS */ |
| 25 | 25 |
/******************************************************************************/ |
| 26 |
#include <aos_debug.h> |
|
| 27 |
#include <chprintf.h> |
|
| 28 |
#include <aos_thread.h> |
|
| 29 |
// No unit testing! -> Contains the Deca Demo Application |
|
| 30 |
#include <deca_instance.h> |
|
| 31 |
#include <alld_dw1000.h> |
|
| 32 |
#include <alld_dw1000_regs.h> |
|
| 33 |
#include <math.h> |
|
| 34 | 26 |
|
| 35 | 27 |
/******************************************************************************/ |
| 36 | 28 |
/* EXPORTED VARIABLES */ |
| unittests/periphery-lld/src/ut_alld_hmc5883l.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <alld_hmc5883l.h> |
|
| 49 |
#include <aos_thread.h> |
|
| 50 |
#include <aos_system.h> |
|
| 51 | 46 |
|
| 52 | 47 |
/** |
| 53 | 48 |
* @brief HMC5338L unit test function. |
| unittests/periphery-lld/src/ut_alld_ina219.c | ||
|---|---|---|
| 20 | 20 |
|
| 21 | 21 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_INA219)) || defined(__DOXYGEN__) |
| 22 | 22 |
|
| 23 |
#include <aos_debug.h> |
|
| 24 |
#include <chprintf.h> |
|
| 25 |
#include <aos_thread.h> |
|
| 26 |
#include <alld_ina219.h> |
|
| 27 | 23 |
#include <math.h> |
| 28 | 24 |
|
| 29 | 25 |
/******************************************************************************/ |
| unittests/periphery-lld/src/ut_alld_l3g4200d.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <aos_thread.h> |
|
| 49 |
#include <alld_l3g4200d.h> |
|
| 50 | 46 |
|
| 51 | 47 |
/** |
| 52 | 48 |
* @brief L3G4200D unit test function. |
| unittests/periphery-lld/src/ut_alld_led.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <alld_led.h> |
|
| 49 |
#include <aos_thread.h> |
|
| 50 | 46 |
|
| 51 | 47 |
/** |
| 52 | 48 |
* @brief LED unit test function. |
| unittests/periphery-lld/src/ut_alld_lis331dlh.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <aos_thread.h> |
|
| 49 |
#include <alld_lis331dlh.h> |
|
| 50 | 46 |
|
| 51 | 47 |
/** |
| 52 | 48 |
* @brief LIS331DLH unit test function. |
| unittests/periphery-lld/src/ut_alld_ltc4412.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <aos_thread.h> |
|
| 49 |
#include <alld_ltc4412.h> |
|
| 50 | 46 |
|
| 51 | 47 |
aos_utresult_t utAlldLtc4412Func(BaseSequentialStream* stream, aos_unittest_t* ut) |
| 52 | 48 |
{
|
| unittests/periphery-lld/src/ut_alld_mpr121.c | ||
|---|---|---|
| 23 | 23 |
/******************************************************************************/ |
| 24 | 24 |
/* LOCAL DEFINITIONS */ |
| 25 | 25 |
/******************************************************************************/ |
| 26 |
#include <aos_debug.h> |
|
| 27 |
#include <chprintf.h> |
|
| 28 |
#include <aos_thread.h> |
|
| 29 |
#include <amiroos.h> |
|
| 30 | 26 |
|
| 31 | 27 |
#define INTERRUPT_EVENT_ID 1 |
| 32 | 28 |
|
| unittests/periphery-lld/src/ut_alld_mpu6050.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <aos_thread.h> |
|
| 49 |
#include <alld_mpu6050.h> |
|
| 50 |
#include <math.h> |
|
| 51 | 46 |
|
| 52 | 47 |
aos_utresult_t utAlldMpu6050Func(BaseSequentialStream* stream, aos_unittest_t* ut) |
| 53 | 48 |
{
|
| unittests/periphery-lld/src/ut_alld_pca9544a.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <aos_thread.h> |
|
| 49 |
#include <alld_pca9544a.h> |
|
| 50 | 46 |
|
| 51 | 47 |
aos_utresult_t utAlldPca9544aFunc(BaseSequentialStream* stream, aos_unittest_t* ut) |
| 52 | 48 |
{
|
| unittests/periphery-lld/src/ut_alld_pcal6524.c | ||
|---|---|---|
| 20 | 20 |
|
| 21 | 21 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_PCAL6524)) || defined(__DOXYGEN__) |
| 22 | 22 |
|
| 23 |
#include <chprintf.h> |
|
| 24 | 23 |
#include <string.h> |
| 25 | 24 |
|
| 26 | 25 |
/******************************************************************************/ |
| unittests/periphery-lld/src/ut_alld_pklcs1212e4001.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <aos_thread.h> |
|
| 49 | 46 |
|
| 50 | 47 |
aos_utresult_t utAlldPklcs1212e4001Func(BaseSequentialStream* stream, aos_unittest_t* ut) |
| 51 | 48 |
{
|
| unittests/periphery-lld/src/ut_alld_tlc5947.c | ||
|---|---|---|
| 20 | 20 |
|
| 21 | 21 |
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && defined(AMIROLLD_CFG_USE_TLC5947)) || defined(__DOXYGEN__) |
| 22 | 22 |
|
| 23 |
#include <aos_debug.h> |
|
| 24 |
#include <chprintf.h> |
|
| 25 |
#include <alld_tlc5947.h> |
|
| 26 | 23 |
#include <string.h> |
| 27 |
#include <aos_thread.h> |
|
| 24 |
|
|
| 28 | 25 |
/******************************************************************************/ |
| 29 | 26 |
/* LOCAL DEFINITIONS */ |
| 30 | 27 |
/******************************************************************************/ |
| unittests/periphery-lld/src/ut_alld_tps2051bdbv.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 | 46 |
|
| 49 | 47 |
/** |
| 50 | 48 |
* @brief TPS2051BDBV unit test function. |
| unittests/periphery-lld/src/ut_alld_tps62113.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <aos_thread.h> |
|
| 49 |
#include <alld_tps62113.h> |
|
| 50 | 46 |
|
| 51 | 47 |
aos_utresult_t utAlldTps62113Func(BaseSequentialStream* stream, aos_unittest_t* ut) |
| 52 | 48 |
{
|
| unittests/periphery-lld/src/ut_alld_tps62113_ina219.c | ||
|---|---|---|
| 43 | 43 |
/******************************************************************************/ |
| 44 | 44 |
/* EXPORTED FUNCTIONS */ |
| 45 | 45 |
/******************************************************************************/ |
| 46 |
#include <aos_debug.h> |
|
| 47 |
#include <chprintf.h> |
|
| 48 |
#include <aos_thread.h> |
|
| 49 | 46 |
|
| 50 | 47 |
aos_utresult_t utAlldTps62113Ina219Func(BaseSequentialStream *stream, aos_unittest_t *ut) |
| 51 | 48 |
{
|
| unittests/periphery-lld/src/ut_alld_vcnl4020.c | ||
|---|---|---|
| 23 | 23 |
/******************************************************************************/ |
| 24 | 24 |
/* LOCAL DEFINITIONS */ |
| 25 | 25 |
/******************************************************************************/ |
| 26 |
#include <aos_debug.h> |
|
| 27 |
#include <chprintf.h> |
|
| 28 |
#include <aos_thread.h> |
|
| 29 |
#include <alld_vcnl4020.h> |
|
| 30 |
#include <amiroos.h> |
|
| 31 | 26 |
|
| 32 | 27 |
#define INTERRUPT_EVENT_ID 1 |
| 33 | 28 |
|
Also available in: Unified diff