Skip to content

Commit

Permalink
Feather m0 support (#1)
Browse files Browse the repository at this point in the history
* featherM0 cmake & HardwareRateDriver

* Add basic timer, support for featherM0

update basic timer

commit 01dc1ccb5034822ace8c6c6477b0e964dc5ebdbc
Author: Ethan Chee <[email protected]>
Date:   Tue Jul 18 15:37:08 2023 -0700

    Move setup_arduino_libraries call for i2c linking

commit 98ada04b3903b5fb61ac5ce28e5bbf7f0da0a42e
Author: Ethan Chee <[email protected]>
Date:   Mon Jul 17 22:41:54 2023 -0700

    Fix I2cDriver Wire.h linking error

commit 2f35207ff70904782ab98d034404b550757f736c
Author: Ethan Chee <[email protected]>
Date:   Fri Jun 23 10:20:25 2023 -0700

    teensy32 cmake compile options

commit 91d43b0456ba9b560a0af0abf63befc5ea86aa10
Author: Ethan Chee <[email protected]>
Date:   Tue Jun 20 09:46:21 2023 -0700

    I2C Driver requires Wire library

commit cd6aa4cca01d6492d8cd1dd10e0927ca6be80a76
Author: Ethan Chee <[email protected]>
Date:   Thu Jun 15 17:39:42 2023 -0700

    Restrict platform ArduinoFw

commit 625a6f488c4b432c5fd81457c80d9411c8c0e459
Author: Ethan Chee <[email protected]>
Date:   Mon Jun 12 14:14:22 2023 -0700

    cleanup

commit 59273b4f89274a9c5b66668a7edd90ad61e5ed18
Author: Ethan Chee <[email protected]>
Date:   Thu Jun 8 08:53:28 2023 -0700

    Add I2cDriver.close() / Wire.end()

commit 2cb7fca1c57ec5a886c98c75f176875ca797397d
Author: Ethan Chee <[email protected]>
Date:   Wed Jun 7 17:30:16 2023 -0700

    Arduino I2cDriver

commit 91ac63cd11ae2d13f2dfbf636e5d3a9478c4871e
Author: Ethan Chee <[email protected]>
Date:   Wed May 31 15:30:11 2023 -0700

    compile bug fixes for featherM0 and teensy41

commit 8d77126e8df261223b3d3eb190718013f31f7ffe
Merge: 068d725 36588d2
Author: Ethan Chee <[email protected]>
Date:   Wed May 31 15:20:47 2023 -0700

    Merge pull request #2 from SterlingPeet/mbed-work

    Mbed work

commit 36588d25ebb26375f05d6d47ea46d82f6898004d
Author: M Starch <[email protected]>
Date:   Wed May 31 12:31:27 2023 -0700

    Fixing multiple target definitions when using multiple deployments

commit e58ed092cec5c98d047aa7d21d7f2b53c5ab37b0
Author: M Starch <[email protected]>
Date:   Wed May 31 12:12:27 2023 -0700

    Bug fixes for stream driver work

commit e3c5ca4fa4504451cb10fed6896c0dc3450a5d51
Author: M Starch <[email protected]>
Date:   Sun May 28 14:37:20 2023 -0700

    Adding featherrp20404rfm

commit 91f7d214d839a5f2c35d5eaa03cf760287d41e83
Author: M Starch <[email protected]>
Date:   Sun May 28 14:36:45 2023 -0700

    Changing serial driver to stream driver

commit cb6a9a211234427440074953eeb9603d04bc47c5
Author: M Starch <[email protected]>
Date:   Thu May 25 09:46:03 2023 -0700

    Working rp2040 builds

commit 109f23748726f2e91ddbc15aae37edacda3c4b6e
Merge: b498ed3 068d725
Author: M Starch <[email protected]>
Date:   Wed May 24 18:48:10 2023 -0700

    Merge pull request #7 from ethancheez/mbed++

    support for feather

commit 068d725ae3f56c15662faada6f2b4a73d936489d
Author: Ethan Chee <[email protected]>
Date:   Wed May 24 17:54:29 2023 -0700

    support for feather

commit b498ed378676fb10644a070f0fd63eb357850966
Author: M Starch <[email protected]>
Date:   Thu May 18 13:16:22 2023 -0700

    Fixing rate driver to drive

commit fb7e074ba1fd5c92a9a3107628422d7ab18679b4
Author: M Starch <[email protected]>
Date:   Wed May 17 11:11:08 2023 -0700

    Minor fixes to post-command and C++ improvements

commit b5e93fc8afd788445c487940b7bcef9bbd71b010
Author: M Starch <[email protected]>
Date:   Fri May 12 20:10:04 2023 -0700

    Initial work with external script

commit 8c22756077c51e4a103718823694bc07e5ccb9a2
Author: M Starch <[email protected]>
Date:   Sat Feb 25 00:07:40 2023 -0800

    initial mbed work

commit b833e631bae74d352e6ac0006f3474eca1828b23
Author: M Starch <[email protected]>
Date:   Fri Dec 16 17:29:17 2022 -0800

    cleaned up arduino library support

commit 1caa5310d72f15f01343a206b22eb757ad4f17b6
Author: M Starch <[email protected]>
Date:   Fri Dec 16 15:57:31 2022 -0800

    library support working for teensy41

commit 36cdc56c628641670df680abdc47732b2baba042
Author: M Starch <[email protected]>
Date:   Wed Dec 14 12:00:36 2022 -0800

    adding SPI.h

commit af11d22d449b37f939d7a7c542858c86b6679738
Author: M Starch <[email protected]>
Date:   Wed Dec 14 02:22:47 2022 -0800

    fixing .hex copy

commit 0c16693ace157ca3f9ecfe71f87698584b2664cd
Author: M Starch <[email protected]>
Date:   Wed Dec 14 02:02:43 2022 -0800

    adding .hex file to install

commit 69cfe2edd6f157762c48e8557e3f09e53b34c8bf
Author: M Starch <[email protected]>
Date:   Wed Dec 14 01:51:01 2022 -0800

    updating to handle archiving and ranlib

commit 2bf1ba487197fa9cd6ea4d61bed923e7396fb12e
Author: M Starch <[email protected]>
Date:   Tue Dec 13 23:23:13 2022 -0800

    adding wire library

commit 63ad8f163d0633d44922c386c5c64e34b88beb98
Author: M Starch <[email protected]>
Date:   Tue Dec 13 11:07:03 2022 -0800

    fixing serial driver to report ready

commit b4ff7fb685e9135f10b1db8be086fea2d0a370c0
Author: M Starch <[email protected]>
Date:   Tue Dec 13 09:11:49 2022 -0800

    fixing serial driver, gpio driver, stream log

commit 207fa6e42e27f19acab5240bed1a1e3da64d7bb5
Author: M Starch <[email protected]>
Date:   Wed Dec 7 21:27:43 2022 -0800

    lestarch: working on teensy32

commit 7421568bad4cd0ceb02662db22c8a6df66286985
Author: M Starch <[email protected]>
Date:   Wed Dec 7 19:18:29 2022 -0800

    removing old arduino support

commit 2c891be4e95cb373974d8f1702061ebcba175288
Author: M Starch <[email protected]>
Date:   Wed Dec 7 19:04:44 2022 -0800

    lestarch: adding teensy 4 toolchains

commit 106e2fe22618e8da22ffda61b5399514b2a7cd3e
Author: M Starch <[email protected]>
Date:   Sun Oct 16 13:07:10 2022 -0700

    lestarch: cleaning up linking command

commit 3b8720b7319be4166d947a0e44f226743452a18c
Author: M Starch <[email protected]>
Date:   Sun Oct 16 12:37:37 2022 -0700

    lestarch: updating components for fprime 3, fixing linking

commit 042e0a745e850dd253c4e0a24f148d11f78dcf4c
Author: Sterling Peet <[email protected]>
Date:   Sun Oct 16 11:13:45 2022 -0500

    WIP: Kludge to update HardwareRateDriver without config

commit d97e366966d5a09b82d8c11188247a76fec6421a
Author: Sterling Peet <[email protected]>
Date:   Sun Oct 16 10:52:55 2022 -0500

    Kludge to remove configuration from Serial Driver that is not accessible

commit 4d919fab594cacadf52bdf250b94f235dafa9e3d
Author: Sterling Peet <[email protected]>
Date:   Sat Oct 15 12:10:31 2022 -0500

    Add kludgy support for TimerOne library, to be generalized later...

commit 824115ef41668d8787e0482b103fd68e1519b437
Author: M Starch <[email protected]>
Date:   Fri Oct 14 13:24:32 2022 -0700

    lestarch: more AVR fixes

commit 8ff13c4a81998532b3d4a13696fcda4894f6431c
Author: Sterling Peet <[email protected]>
Date:   Fri Oct 14 14:30:47 2022 -0400

    Add new header for OS tasks

commit dea454604830a1724b2d53d50a3ac788425be625
Author: Sterling Peet <[email protected]>
Date:   Fri Oct 14 14:16:19 2022 -0400

    First pass at ATmega128 support

commit 054dae63d75e6bf7d14c91deffea398a55b87d32
Author: M Starch <[email protected]>
Date:   Thu Oct 13 09:01:00 2022 -0700

    lestarch: gpio driver rework

commit c85d1831b2ad4b938a3be073746a6ba20e512b23
Author: M Starch <[email protected]>
Date:   Fri Oct 7 16:45:25 2022 -0700

    lestarch: adding gpio driver and refactoring types

commit d9b932cff4a1f58be42565901c6cd953db3e3393
Author: M Starch <[email protected]>
Date:   Fri Oct 7 13:46:28 2022 -0700

    lestarch: refactoring standard components

commit cafcad69a53f9fea8c817ddb29dc38a604d3f6ac
Author: M Starch <[email protected]>
Date:   Sat Oct 1 09:33:22 2022 -0700

    lestarch: arduino package WIP

commit b95919382c4f627f27b2d099f9f37b8f7a28bd7f
Author: M Starch <[email protected]>
Date:   Mon Sep 26 17:53:01 2022 -0700

    lestarch: rearranging former Arduino packages

commit 72e5a5e6c0d01708aa0801a501e495ad22d1507b
Author: M Starch <[email protected]>
Date:   Mon Sep 26 17:44:35 2022 -0700

    lestarch: arduino-cli passes cmake compile checks

commit 379c1ff8110fc06a32179ddd914f29a776b39e6e
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 16:16:07 2021 -0500

    missed slashes

commit 99cdf44b8a110f8f3ecbc8c5c5f37c04c5813e2a
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 16:14:22 2021 -0500

    fix file paths

commit 7191510d58ed51e2cddd31c2a53788a7877ca6ea
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 16:12:09 2021 -0500

    dont print all that

commit 04d4288c2847f9fa9c7938edfcd86308ae414d44
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 14:24:09 2021 -0500

    Fix missing definitions

commit fba21d0319626bd985dfd7b68b1556da2cfe24d6
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 08:55:19 2021 -0500

    add init to HardwareRateDriver and fix path to TimerOne library

commit f7cc6e19c6687a35527e6f4cd2be0673d9a36dae
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 00:49:58 2021 -0500

    fix HardwareRateDriver paths

commit fc28e79069316afb481138eb6c9eb3366992b341
Author: Sterling Peet <[email protected]>
Date:   Wed Nov 10 00:08:46 2021 -0500

    Update paths in AssertReset

commit 29bb59b03ffb8b5c597427e34d823297d1ef20b4
Author: Sterling Peet <[email protected]>
Date:   Tue Nov 9 23:55:36 2021 -0500

    ATmega Types

commit 88b334ee22c03cb88f343e721a36c2cba7b5041f
Author: Sterling Peet <[email protected]>
Date:   Tue Nov 9 23:44:07 2021 -0500

    cmake generation works, not building yet

commit b0f7e63d46c3ce3f6098c82047badb327125de76
Author: Sterling Peet <[email protected]>
Date:   Tue Nov 9 22:41:18 2021 -0500

    Add ATmega folders and components

commit 08eefead00fdb7028ab2daa88d17199f0333a357
Author: Sterling Peet <[email protected]>
Date:   Sun Oct 24 21:49:38 2021 -0400

    Add starting point for toolchain and platform files

commit b80102df98e466c9c4d30dac6761d0d943e34dd2
Author: Sterling Peet <[email protected]>
Date:   Sun Oct 24 20:07:52 2021 -0400

    add some things to get started

merge esp32

merge rpipicow

merge spi-driver

cleanup and bug fixes

Fix bug causing use of -isystem instead of -I

ATmega128 support (#3)

* ATmega128 builds

* Update basic types for ATmega missing dependencies

fix ATmega128 TimerOne include (#4)

* ATmega128 builds

* Update basic types for ATmega missing dependencies

* use basic timer instead of TimerOne (ATmega128)

add pico

Minor renaming and adjustments

Minor fixes to hqardware rate driver

Adding missing files from previous implementation
  • Loading branch information
ethancheez authored and LeStarch committed Aug 12, 2023
1 parent 872c5cf commit 324423b
Show file tree
Hide file tree
Showing 303 changed files with 27,841 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build-*
.DS_Store
.vscode
32 changes: 32 additions & 0 deletions ATmega/ATmegaOs/AVR/IntervalTimer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <Os/IntervalTimer.hpp>
#include <Fw/Types/Assert.hpp>
#include <time.h>
#include <string.h>

namespace Os {

void IntervalTimer::getRawTime(RawTime& time) {
// TODO: need to set up timekeeping
U32 msec = 0; // millis();
U32 usec = 0; // micros();

time.upper = msec/1000;
time.lower = usec;
}

// Adapted from: http://www.gnu.org/software/libc/manual/html_node/Elapsed-Time.html
// should be t1In - t2In
U32 IntervalTimer::getDiffUsec(const RawTime& t1In, const RawTime& t2In) {

RawTime result = {t1In.upper - t2In.upper,0};

if (t1In.lower < t2In.lower) {
result.upper -= 1; // subtract nsec carry to seconds
result.lower = t1In.lower + (1000000000 - t2In.lower);
} else {
result.lower = t1In.lower - t2In.lower;
}

return result.upper*1000000 + result.lower / 1000;
}
}
48 changes: 48 additions & 0 deletions ATmega/ATmegaOs/AVR/XMem.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* XMem.hpp:
*
* This file contains the setup sequence that is needed to enable the
* ATmega XMEM interface. It must be included in the main project
* file to be linked correctly in the final executable.
*
* Created on: March 25, 2020
* Author: Sterling Peet <[email protected]>
*/

#include <avr/io.h>

#ifndef OS_AVR_XMEM_HPP_
#define OS_AVR_XMEM_HPP_

void xmem_init(void) __attribute__ ((naked, used, section(".init3")));

void xmem_init(void)
{
// Set up the XMEM interface
XMCRB = 0; // need all 64K. no pins released
#if defined(__AVR_ATmega128__)
MCUCR = _BV(SRE); // enable xmem, no wait states
#else
XMCRA = _BV(SRE); // enable xmem, no wait states
#endif

// set up the bank selector pins (address lines A16..A18)
// these are on pins 38,42,43 (PD7,PL7,PL6)
#if defined(__AVR_ATmega128__)
DDRD |= (_BV(PD5)|_BV(PD6)|_BV(PD7));
#else
DDRD |= _BV(PD7);
DDRL |= (_BV(PL6)|_BV(PL7));
#endif

// set the bank selector pins (address lines A16..A18)
// to zero only, we aren't doing fancy mem page swapping right now
#if defined(__AVR_ATmega128__)
PORTD &= ~(_BV(PD5)|_BV(PD6)|_BV(PD7));
#else
PORTD &= ~_BV(PD7);
PORTL &= ~(_BV(PL6)|_BV(PL7));
#endif
}

#endif /* OS_AVR_XMEM_HPP_ */
35 changes: 35 additions & 0 deletions ATmega/ATmegaOs/Arduino/IntervalTimer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <Os/IntervalTimer.hpp>
#include <Fw/Types/Assert.hpp>
#include <time.h>
#include <errno.h>
#include <string.h>
#include <Arduino.h>

namespace Os {

void IntervalTimer::getRawTime(RawTime& time) {
// U32 msec = millis();
U32 usec = micros();

// This feels like a terrible kludge, but all we really
// care about is a difference in microseconds, right?
time.upper = 0; //msec/1000;
time.lower = usec;
}

// Adapted from: https://www.gnu.org/software/libc/manual/html_node/Calculating-Elapsed-Time.html
// should be t1In - t2In
U32 IntervalTimer::getDiffUsec(const RawTime& t1In, const RawTime& t2In) {

RawTime result = {t1In.upper - t2In.upper,0};

if (t1In.lower < t2In.lower) {
result.upper -= 1; // subtract nsec carry to seconds
result.lower = t1In.lower + (1000000 - t2In.lower);
} else {
result.lower = t1In.lower - t2In.lower;
}

return result.upper * 1000000 + result.lower;
}
}
57 changes: 57 additions & 0 deletions ATmega/ATmegaOs/Arduino/StreamLog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* LogArduinoStream:
*
* Implementation of Os::Log that defers to Arduino's Stream type. This allows for a hardware based
* stream capture. Note: in order to set the stream, the companion header Os/Arduino/StreamLog.hpp
* should be used.
*
* Created on: Apr 13, 2019
* Author: lestarch
*/

#include <Os/Log.hpp>
#include <ATmega/ATmegaOs/Arduino/StreamLog.hpp>

extern "C" {
#include <stdio.h>
#include <string.h>
}

namespace Os {
Stream* A_STREAM = NULL; // I love it when a plan comes together.
void setArduinoStreamLogHandler(Stream* stream) {
A_STREAM = stream;
}
Log::Log() {

// Register myself as a logger at construction time. If used in unison with LogDefault.cpp, this will
// automatically create this as a default logger.
this->registerLogger(this);
}
/**
* An Arduino Stream implementation of the Os::Log function. Essentially, this log message
* handler formats a message an sends it out to the serial port/Wire port or Arduino stream
* backing the stream object. This allows for a side-channel serial console.
*/
void Log::log(
const char* fmt,
POINTER_CAST a0,
POINTER_CAST a1,
POINTER_CAST a2,
POINTER_CAST a3,
POINTER_CAST a4,
POINTER_CAST a5,
POINTER_CAST a6,
POINTER_CAST a7,
POINTER_CAST a8,
POINTER_CAST a9
) {
char message[128];
// If stream is defined, then write to it.
if (A_STREAM != NULL) {
U32 used = snprintf(message, sizeof(message), fmt, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
used = (used > sizeof(message)) ? sizeof(message) : used;
A_STREAM->write(message, used);
}
}
}
21 changes: 21 additions & 0 deletions ATmega/ATmegaOs/Arduino/StreamLog.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* StreamLog.hpp:
*
* A file defining the functions used to set and configure the Stream used in the Arduino Log::Os
* handler function.
*
* Created on: Apr 13, 2019
* Author: lestarch
*/
#ifndef OS_ARDUINO_STREAMLOG_HPP_
#define OS_ARDUINO_STREAMLOG_HPP_
#include <Arduino.h>

namespace Os {
/**
* Sets the global A_STREAM arduino stream used to log Arudino messages through a hardware "Steam"
* like UART or I2C.
*/
void setArduinoStreamLogHandler(Stream* stream);
}
#endif /* OS_ARDUINO_STREAMLOG_HPP_ */
76 changes: 76 additions & 0 deletions ATmega/ATmegaOs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
####
# F prime CMakeLists.txt:
#
# SOURCE_FILES: combined list of source and autocoding files
# MOD_DEPS: (optional) module dependencies
#
####
cmake_minimum_required(VERSION 3.13)
cmake_policy(SET CMP0079 NEW)

# Basic module dependencies
set(MOD_DEPS
Fw/Cfg
Fw/Types
Fw/Logger
Utils/Hash
)
# Determine the platform specific source files to append:

string(TOLOWER "${CMAKE_SYSTEM_NAME}" CMAKE_SYSTEM_NAME_LOWER)

# Arduino additions
if (${CMAKE_SYSTEM_NAME_LOWER} STREQUAL "arduino")
set(SOURCE_FILES
# Common implementations
"${FPRIME_FRAMEWORK_PATH}/Os/TaskCommon.cpp"
"${FPRIME_FRAMEWORK_PATH}/Os/TaskString.cpp"
"${FPRIME_FRAMEWORK_PATH}/Os/QueueCommon.cpp"
"${FPRIME_FRAMEWORK_PATH}/Os/QueueString.cpp"
# Baremetal virtualization implementations
"${FPRIME_FRAMEWORK_PATH}/Os/Baremetal/Queue.cpp"
"${FPRIME_FRAMEWORK_PATH}/Os/Baremetal/Task.cpp"
"${FPRIME_FRAMEWORK_PATH}/Os/Baremetal/File.cpp"
"${FPRIME_FRAMEWORK_PATH}/Os/Baremetal/FileSystem.cpp"
"${FPRIME_FRAMEWORK_PATH}/Os/Baremetal/IntervalTimer.cpp"
"${FPRIME_FRAMEWORK_PATH}/Os/Baremetal/Mutex.cpp"
# Non-OS based queue implementations
"${FPRIME_FRAMEWORK_PATH}/Os/Pthreads/BufferQueueCommon.cpp"
"${FPRIME_FRAMEWORK_PATH}/Os/Pthreads/FIFOBufferQueue.cpp"
# From this package: an interval timer and a stream-log timer
"${CMAKE_CURRENT_LIST_DIR}/Arduino/IntervalTimer.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Arduino/StreamLog.cpp"
)
# AVR platform additions
elseif(${CMAKE_SYSTEM_NAME_LOWER} STREQUAL "avr")
set(SOURCE_FILES "${CMAKE_CURRENT_LIST_DIR}/AVR/IntervalTimer.cpp")
endif()

register_fprime_module()


####
# Dependency Melding:
#
# In short, this Os layer depends on the framework's Os layer and vise-versa. Effectively it is one
# library built in two halves, the framework base, and this add on. Here we make the link pointers
# depend on one another forming a (weak) circular dependency. This is allowed in CMake 3.13 and
# newer.
####
if (${CMAKE_SYSTEM_NAME_LOWER} STREQUAL "arduino")
add_dependencies(Os ATmega_ATmegaOs)
target_link_libraries(Os ATmega_ATmegaOs)
target_link_libraries(ATmega_ATmegaOs Os)
endif()

# Add Arduino dependency
if(${CMAKE_SYSTEM_NAME_LOWER} STREQUAL "arduino")
get_module_name(${CMAKE_CURRENT_LIST_DIR})
add_arduino_dependency("${MODULE_NAME}")
endif()

# Add AVR dependency
if(${CMAKE_SYSTEM_NAME_LOWER} STREQUAL "avr")
get_module_name(${CMAKE_CURRENT_LIST_DIR})
add_avr_dependency("${MODULE_NAME}")
endif()
8 changes: 8 additions & 0 deletions ATmega/ATmegaTypes/AVR/StandardTypes.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

#define NAME_MAX 64
#define PATH_MAX 128

extern "C" {
#include <stdint.h>
#include <stdlib.h>
} // extern "C"
6 changes: 6 additions & 0 deletions ATmega/ATmegaTypes/Arduino/StandardTypes.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdint.h>
#define NAME_MAX 255
typedef int TaskIdRepr;
#define FPRIME_OVERRIDE_NATIVE_TYPES
typedef int32_t NATIVE_INT_TYPE;
typedef uint32_t NATIVE_UINT_TYPE;
3 changes: 3 additions & 0 deletions ATmega/ATmegaTypes/cstdarg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extern "C" {
#include <stdarg.h>
} // extern "C"
3 changes: 3 additions & 0 deletions ATmega/ATmegaTypes/cstdio
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extern "C" {
#include <stdio.h>
} // extern "C"
3 changes: 3 additions & 0 deletions ATmega/ATmegaTypes/cstring
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extern "C" {
#include <string.h>
} // extern "C"
50 changes: 50 additions & 0 deletions ATmega/Drv/ATmegaAdcDriver/ATmegaAdcDriverComponentAi.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>

<?xml-model href="../../../fprime/Autocoders/Python/default/schema/ISF/component_schema.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>

<component name="ATmegaAdcDriver" kind="passive" namespace="Drv">

<import_port_type>Svc/Sched/SchedPortAi.xml</import_port_type>
<import_port_type>ATmega/Drv/U16Array/U16ArrayPortAi.xml</import_port_type>


<comment>ATmega ADC reader component.</comment>

<ports>
<port name = "tlmSched" data_type = "Svc::Sched" kind="sync_input">
<comment>
Schedule from rate group to determine when to take readings and report
</comment>
</port>
<port name = "Report" data_type = "U16Array" kind="output" max_number="10">
<comment>
Sends ADC reading multiplied by gains to components which use them
</comment>
</port>
</ports>
<telemetry>
<channel id="0" name="ADC_CNTS" data_type="U16*">
<comment>
Pointer to raw ADC counts array
</comment>
</channel>
<channel id="1" name="ADC_VAL" data_type="U16*">
<comment>
Pointer to ADC readings multiplied by gains
</comment>
</channel>
</telemetry>
<!-- TODO: Figure out why parameters won't parse -->
<!-- <parameters>
<parameter id="0" set_opcode="10" save_opcode="11" name="SCALE" data_type="U16" default="1">
<comments>
Scale value to multiply by ADC reading before reporting to external components
</comments>
</parameter>
<parameter id="1" set_opcode="12" save_opcode="13" name="OFFSET" data_type="I16" default="0">
<comments>
Offset to add to ADC reading AFTER multiplying by SCALE and before reporting to external components
</comments>
</parameter>
</parameters> -->
</component>
Loading

0 comments on commit 324423b

Please sign in to comment.