mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_HAL_AVR_SITL: add initial scaffolding
This commit is contained in:
parent
81d77d2bf4
commit
54bab59066
9
libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL.h
Normal file
9
libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL.h
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
#ifndef __AP_HAL_AVR_SITL_H__
|
||||
#define __AP_HAL_AVR_SITL_H__
|
||||
|
||||
#include "AP_HAL_AVR_SITL_Namespace.h"
|
||||
#include "HAL_AVR_SITL_Class.h"
|
||||
|
||||
#endif // __AP_HAL_AVR_SITL_H__
|
||||
|
9
libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL_Namespace.h
Normal file
9
libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL_Namespace.h
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
#ifndef __AP_HAL_AVR_SITL_NAMESPACE_H__
|
||||
#define __AP_HAL_AVR_SITL_NAMESPACE_H__
|
||||
|
||||
namespace AP_HAL_AVR_SITL {
|
||||
class SITLUARTDriver;
|
||||
}
|
||||
|
||||
#endif // __AP_HAL_AVR_SITL_NAMESPACE_H__
|
49
libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.cpp
Normal file
49
libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
|
||||
#include <AP_HAL.h>
|
||||
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
|
||||
|
||||
#include <AP_HAL_AVR.h>
|
||||
#include <AP_HAL_AVR_private.h>
|
||||
#include <AP_HAL_AVR_SITL.h>
|
||||
#include "AP_HAL_AVR_SITL_Namespace.h"
|
||||
#include "HAL_AVR_SITL_Class.h"
|
||||
|
||||
// XXX placeholder
|
||||
uint8_t isrRegistry;
|
||||
|
||||
static AVRScheduler avrScheduler;
|
||||
|
||||
HAL_AVR_SITL::HAL_AVR_SITL() :
|
||||
AP_HAL::HAL(
|
||||
NULL, /* uartA */
|
||||
NULL, /* uartB */
|
||||
NULL, /* uartC */
|
||||
NULL, /* i2c */
|
||||
NULL, /* spi */
|
||||
NULL, /* analogin */
|
||||
NULL, /* storage */
|
||||
NULL, /* console */
|
||||
NULL, /* gpio */
|
||||
NULL, /* rcinput */
|
||||
NULL, /* rcoutput */
|
||||
&avrScheduler) /* scheduler */
|
||||
{}
|
||||
|
||||
void HAL_AVR_SITL::init(void* machtnichts) const {
|
||||
|
||||
scheduler->init((void*)&isrRegistry);
|
||||
uartA->begin(115200);
|
||||
console->init((void*) uartA);
|
||||
|
||||
rcin->init((void*)&isrRegistry);
|
||||
rcout->init(NULL);
|
||||
spi->init(NULL);
|
||||
i2c->begin();
|
||||
i2c->setTimeout(100);
|
||||
analogin->init(NULL);
|
||||
}
|
||||
|
||||
const HAL_AVR_SITL AP_HAL_AVR_SITL;
|
||||
|
||||
#endif // CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
|
18
libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.h
Normal file
18
libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.h
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
#ifndef __AP_HAL_AVR_SITL_CLASS_H__
|
||||
#define __AP_HAL_AVR_SITL_CLASS_H__
|
||||
|
||||
#include <AP_HAL.h>
|
||||
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
|
||||
|
||||
class HAL_AVR_SITL :: public AP_HAL::HAL {
|
||||
HAL_AVR_SITL();
|
||||
void init(void*) const;
|
||||
};
|
||||
|
||||
extern const HAL_AVR_SITL AP_HAL_AVR_SITL;
|
||||
|
||||
#endif // CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
|
||||
#endif // __AP_HAL_AVR_SITL_CLASS_H__
|
||||
|
Loading…
Reference in New Issue
Block a user