2012-12-14 21:55:38 -04:00
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include <AP_HAL/AP_HAL.h>
|
2012-12-19 02:02:57 -04:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_EMPTY
|
2012-12-14 21:55:38 -04:00
|
|
|
|
|
|
|
#include "HAL_Empty_Class.h"
|
|
|
|
#include "AP_HAL_Empty_Private.h"
|
|
|
|
|
|
|
|
using namespace Empty;
|
|
|
|
|
|
|
|
static EmptyUARTDriver uartADriver;
|
|
|
|
static EmptyUARTDriver uartBDriver;
|
|
|
|
static EmptyUARTDriver uartCDriver;
|
2013-01-04 20:19:51 -04:00
|
|
|
static EmptySemaphore i2cSemaphore;
|
|
|
|
static EmptyI2CDriver i2cDriver(&i2cSemaphore);
|
2012-12-14 21:55:38 -04:00
|
|
|
static EmptySPIDeviceManager spiDeviceManager;
|
|
|
|
static EmptyAnalogIn analogIn;
|
|
|
|
static EmptyStorage storageDriver;
|
|
|
|
static EmptyGPIO gpioDriver;
|
|
|
|
static EmptyRCInput rcinDriver;
|
|
|
|
static EmptyRCOutput rcoutDriver;
|
2012-12-17 15:54:55 -04:00
|
|
|
static EmptyScheduler schedulerInstance;
|
2012-12-18 21:12:41 -04:00
|
|
|
static EmptyUtil utilInstance;
|
2012-12-14 21:55:38 -04:00
|
|
|
|
|
|
|
HAL_Empty::HAL_Empty() :
|
|
|
|
AP_HAL::HAL(
|
|
|
|
&uartADriver,
|
|
|
|
&uartBDriver,
|
|
|
|
&uartCDriver,
|
2013-11-22 04:16:14 -04:00
|
|
|
NULL, /* no uartD */
|
2013-12-21 07:26:10 -04:00
|
|
|
NULL, /* no uartE */
|
2012-12-14 21:55:38 -04:00
|
|
|
&i2cDriver,
|
2015-06-15 14:46:31 -03:00
|
|
|
NULL, /* only one i2c */
|
|
|
|
NULL, /* only one i2c */
|
2012-12-14 21:55:38 -04:00
|
|
|
&spiDeviceManager,
|
|
|
|
&analogIn,
|
|
|
|
&storageDriver,
|
2013-10-05 05:32:35 -03:00
|
|
|
&uartADriver,
|
2012-12-14 21:55:38 -04:00
|
|
|
&gpioDriver,
|
|
|
|
&rcinDriver,
|
|
|
|
&rcoutDriver,
|
2012-12-18 21:12:41 -04:00
|
|
|
&schedulerInstance,
|
|
|
|
&utilInstance),
|
2012-12-17 15:54:55 -04:00
|
|
|
_member(new EmptyPrivateMember(123))
|
2012-12-14 21:55:38 -04:00
|
|
|
{}
|
|
|
|
|
2012-12-17 15:54:55 -04:00
|
|
|
void HAL_Empty::init(int argc,char* const argv[]) const {
|
|
|
|
/* initialize all drivers and private members here.
|
|
|
|
* up to the programmer to do this in the correct order.
|
|
|
|
* Scheduler should likely come first. */
|
|
|
|
scheduler->init(NULL);
|
|
|
|
uartA->begin(115200);
|
|
|
|
_member->init();
|
2012-12-14 21:55:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
const HAL_Empty AP_HAL_Empty;
|
|
|
|
|
2012-12-19 02:02:57 -04:00
|
|
|
#endif
|