You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.3 KiB
57 lines
1.3 KiB
|
|
#include <AP_HAL.h> |
|
|
|
#include "HAL_SMACCM_Class.h" |
|
#include "AP_HAL_SMACCM_Private.h" |
|
|
|
using namespace SMACCM; |
|
|
|
// XXX make sure these are assigned correctly |
|
static SMACCMUARTDriver uartADriver(usart1); |
|
static SMACCMUARTDriver uartBDriver(usart2); |
|
static SMACCMUARTDriver uartCDriver(usart3); |
|
|
|
static SMACCMI2CDriver i2cDriver; |
|
static SMACCMSPIDeviceManager spiDeviceManager; |
|
static SMACCMAnalogIn analogIn; |
|
static SMACCMStorage storageDriver; |
|
static SMACCMConsoleDriver consoleDriver(&uartADriver); |
|
static SMACCMGPIO gpioDriver; |
|
static SMACCMRCInput rcinDriver; |
|
static SMACCMRCOutput rcoutDriver; |
|
static SMACCMScheduler schedulerInstance; |
|
static SMACCMUtil utilInstance; |
|
|
|
HAL_SMACCM::HAL_SMACCM() : |
|
AP_HAL::HAL( |
|
&uartADriver, |
|
&uartBDriver, |
|
&uartCDriver, |
|
&i2cDriver, |
|
&spiDeviceManager, |
|
&analogIn, |
|
&storageDriver, |
|
&consoleDriver, |
|
&gpioDriver, |
|
&rcinDriver, |
|
&rcoutDriver, |
|
&schedulerInstance, |
|
&utilInstance) |
|
{ |
|
} |
|
|
|
void HAL_SMACCM::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); |
|
console->init(uartA); |
|
i2c->begin(); |
|
spi->init(NULL); |
|
storage->init(NULL); |
|
} |
|
|
|
const HAL_SMACCM AP_HAL_SMACCM; |
|
|
|
|