Initial Commit
commit
8ad6e6b88d
|
@ -0,0 +1,110 @@
|
|||
/**
|
||||
* can/can.h avr8 can bus interface api
|
||||
*
|
||||
* (c) 2016 Harald Christian Joachim Wolff
|
||||
*
|
||||
**/
|
||||
#pragma once
|
||||
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/threads.h>
|
||||
|
||||
#include <util/list.h>
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define CAN_SPEED_MASK 0x000F
|
||||
#define CAN_1MBIT 0x0001
|
||||
#define CAN_125KBIT 0x0002
|
||||
|
||||
typedef union {
|
||||
uint8_t bytes[4];
|
||||
uint16_t words[2];
|
||||
struct {
|
||||
uint32_t addr:29;
|
||||
uint32_t rtr:1;
|
||||
uint32_t reserved:1;
|
||||
uint32_t ide:1;
|
||||
};
|
||||
uint32_t value;
|
||||
} canid_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t tx:1;
|
||||
uint8_t error:1;
|
||||
uint8_t reserve:2;
|
||||
uint8_t len:4;
|
||||
} canflags_t;
|
||||
|
||||
typedef union {
|
||||
uint8_t bytes[8];
|
||||
uint16_t words[4];
|
||||
uint32_t dwords[2];
|
||||
uint64_t qword;
|
||||
|
||||
int8_t i8[8];
|
||||
int16_t i16[4];
|
||||
int32_t i32[2];
|
||||
int64_t i64;
|
||||
} canpayload_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
canflags_t flags;
|
||||
canid_t id;
|
||||
canpayload_t
|
||||
payload;
|
||||
|
||||
uint16_t frame_id;
|
||||
|
||||
list_t list;
|
||||
|
||||
thread_t *notify;
|
||||
|
||||
} canframe_t;
|
||||
|
||||
typedef struct {
|
||||
canid_t id;
|
||||
canid_t mask;
|
||||
|
||||
uint16_t last_seen_frame_id;
|
||||
|
||||
list_t list;
|
||||
} canfilter_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t setup;
|
||||
|
||||
int rxpool_next;
|
||||
int rxpool_length;
|
||||
canframe_t *rxpool;
|
||||
|
||||
int frame_id_tx,
|
||||
frame_id_rx;
|
||||
|
||||
list_t rx_filters;
|
||||
list_t tx_queue;
|
||||
|
||||
} _can_device_t;
|
||||
|
||||
int can_init_device(uint32_t config,int rxpool_length);
|
||||
uint32_t can_get_device_config(void);
|
||||
|
||||
int can_send(canframe_t *frame);
|
||||
int can_send_simple(canid_t cid,uint8_t len,canpayload_t payload);
|
||||
|
||||
int can_recv(canfilter_t *filter,canframe_t *frame);
|
||||
int can_recv_timeout(canfilter_t *filter,canframe_t *frame,int ms);
|
||||
|
||||
|
||||
/** OLD API **/
|
||||
|
||||
void can_interface_enable(void) __attribute__((weak));
|
||||
void can_interface_disable(void) __attribute__((weak));
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
#pragma once
|
||||
|
||||
/**
|
||||
*
|
||||
* can/cannode.h Register Based CAN Communication
|
||||
*
|
||||
* (c) 2016 Harald Christian Joachim Wolff
|
||||
*
|
||||
* Beschreibung:
|
||||
*
|
||||
* Ein CAN-Knoten erhält eine Identität (0-15).
|
||||
* Es können Werte der Typen Int32/Float gelesen und geschrieben werden, hierfür wird auf dem Knoten das RB2 System genutzt.
|
||||
* Es findet auf der Knotenseite kein Routing statt!
|
||||
*
|
||||
* Es wird nicht durch einen RB2_LINK kommuniziert, dadurch entsteht die Möglichkeit eine Achseninsel zu errichten in welcher z.B. ein weiterer Motor via HF3/RB2 angeschlossen ist.
|
||||
*
|
||||
* TOP
|
||||
* |
|
||||
* +---MOTOR
|
||||
* |
|
||||
* +--[CANNODE]--LUB2400
|
||||
* | |
|
||||
* | +---MOTOR
|
||||
* |
|
||||
* +--[CANNOD]--LUB2400
|
||||
* | |
|
||||
* | +---MOTOR
|
||||
* +---FRONTPANEL
|
||||
*
|
||||
* CAN-Knoten senden grundsätzlich nur nach Aufforderung. Es findet keine selbstständige Sendung statt!
|
||||
*
|
||||
*
|
||||
* Die CANID (Object-Identifier: OID) wird nach folgendem Schema erstellt:
|
||||
*
|
||||
* Bit Inhalt
|
||||
* --------------------------------------
|
||||
* 0..15 Field / Register No
|
||||
* 16..19 Reserved 0
|
||||
* 20..23 Ax identity
|
||||
* 24..28 0
|
||||
*
|
||||
* Beschreibung der Nachrichtentypen:
|
||||
*
|
||||
* Bezeichnung Länge RTR Beschreibung
|
||||
* Payload
|
||||
* --------------------------------------------------------
|
||||
*
|
||||
* READ 0 Ja Anfordern eines Registerwertes
|
||||
*
|
||||
* READ EXT. 2 Nein Anfordern von <N> aufeinanderfolgenden Registerwerten
|
||||
* 0-1 <N>
|
||||
*
|
||||
* WRITE 6 Nein Schreibanforderung
|
||||
* 0-3 <Wert>
|
||||
* 4 Typ von <Wert>
|
||||
* 5 Reserviert 0
|
||||
*
|
||||
* REPLY 5 Nein Mitteilung über aktuellen Registerwert
|
||||
* 0-3 <Wert>
|
||||
* 4 Typ von <Wert>
|
||||
*
|
||||
* Kommunikationsbeschreibung
|
||||
* --------------------------
|
||||
*
|
||||
* Wert lesen:
|
||||
* 1. READ
|
||||
* 2. REPLY
|
||||
*
|
||||
* Wert schreiben:
|
||||
* 1. WRITE
|
||||
* 2. REPLY
|
||||
*
|
||||
* Wertegruppe lesen:
|
||||
* 1. READ EXT.
|
||||
* 2. <N> x REPLY
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
#include <can/can.h>
|
||||
#include <rb2/regbus.h>
|
||||
|
||||
#include <sys/assert.h>
|
||||
|
||||
#define CNT_INT32 RDT_INT32
|
||||
#define CNT_FLOAT RDT_FLOAT
|
||||
|
||||
typedef struct {
|
||||
int identity;
|
||||
|
||||
register_node_proc
|
||||
node_proc;
|
||||
|
||||
canfilter_t
|
||||
rxfilter;
|
||||
|
||||
} cannode_t;
|
||||
|
||||
/**
|
||||
* @brief Erstellt ein cannode_t objekt.
|
||||
* @param identity Die Identität des CAN Node (0..15)
|
||||
* @return 0 bei Erfolg, sonst -E...
|
||||
*/
|
||||
cannode_t* can_node_create(int identity,register_node_proc node_proc);
|
||||
|
||||
/**
|
||||
* @brief Behandelt empfangene Nachrichten für einen CAN Node
|
||||
* @param cn cannode_t objekt
|
||||
* @return 0 bei Erfolg, sonst -E...
|
||||
*/
|
||||
int can_node_handler(cannode_t *cn);
|
||||
|
||||
|
||||
int can_node_read (int node,unsigned int reg,uint8_t *type,void *buffer);
|
||||
int can_node_write (int node,unsigned int reg,uint8_t type,void *buffer);
|
||||
|
||||
static inline int can_node_write_int32(int node,unsigned int reg,int32_t value){
|
||||
return can_node_write( node, reg, CNT_INT32, &value );
|
||||
};
|
||||
|
||||
static inline int can_node_write_float(int node,unsigned int reg,float value){
|
||||
return can_node_write( node, reg, CNT_FLOAT, &value );
|
||||
};
|
||||
|
||||
static inline int can_node_read_int32(int node,unsigned int reg,int32_t *value){
|
||||
uint8_t t = CNT_INT32;
|
||||
assert( can_node_read( node, reg, &t, value ) );
|
||||
if (t != CNT_INT32){
|
||||
*value = (int32_t)*(float*)value;
|
||||
};
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
static inline int can_node_read_float(int node,unsigned int reg,float *value){
|
||||
uint8_t t = CNT_FLOAT;
|
||||
assert( can_node_read( node, reg, &t, value ) );
|
||||
if (t != CNT_FLOAT){
|
||||
*value = (float)*(int32_t*)value;
|
||||
};
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
#pragma once
|
||||
|
||||
#include <can/can.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <util/list.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/** Constants... **/
|
||||
#define J_LONG 11
|
||||
#define J_FLOAT 12
|
||||
|
||||
typedef struct jetterSlave
|
||||
{
|
||||
uint16_t refID;
|
||||
uint8_t modcode;
|
||||
|
||||
} JSlave;
|
||||
|
||||
|
||||
typedef struct jetterParm
|
||||
{
|
||||
uint8_t slave;
|
||||
uint16_t parm;
|
||||
uint8_t flags;
|
||||
|
||||
uint32_t lastReadValue;
|
||||
} JParm;
|
||||
|
||||
typedef struct jetcan_state
|
||||
{
|
||||
uint8_t initialized:1;
|
||||
|
||||
MUTEX mutex;
|
||||
} JState;
|
||||
|
||||
struct jetcan_request
|
||||
{
|
||||
list_t list;
|
||||
|
||||
uint8_t read:1;
|
||||
uint8_t write:1;
|
||||
uint8_t typint:1;
|
||||
uint8_t typfloat:1;
|
||||
|
||||
uint8_t slave;
|
||||
uint16_t register_no;
|
||||
|
||||
uint8_t retry;
|
||||
|
||||
union {
|
||||
int32_t i32;
|
||||
float f32;
|
||||
};
|
||||
};
|
||||
|
||||
struct jetcan_status
|
||||
{
|
||||
list_t requests;
|
||||
};
|
||||
|
||||
struct _jetcan {
|
||||
MUTEX lock;
|
||||
uint8_t nSlaves;
|
||||
JSlave slaves[4];
|
||||
};
|
||||
|
||||
extern struct _jetcan jetcan;
|
||||
|
||||
|
||||
extern int32_t _dbg_jetcan_requests,
|
||||
_dbg_jetcan_misses,
|
||||
_dbg_jetcan_timeouts,
|
||||
_dbg_jetcan_rtt,
|
||||
_dbg_jetcan_rtt_min,
|
||||
_dbg_jetcan_rtt_max;
|
||||
|
||||
|
||||
/* jSetCModeCallback()
|
||||
Callback um die CMODE0 und CMODE1 Leitungen zu setzen (Bits 0 + 1 von cmode)
|
||||
*/
|
||||
typedef void (*jSetCModeCallback)(uint8_t cmode);
|
||||
|
||||
/* jSetRegister32Ex - Write Register Value to Slave (via CAN) with Result */
|
||||
int jSetRegister32Ex(uint8_t slave,uint16_t parm,void *pValue,uint8_t type);
|
||||
int jSetRegister32Exl(uint8_t slave,uint16_t parm,int32_t value);
|
||||
int jSetRegister32Exd(uint8_t slave,uint16_t parm,float value);
|
||||
|
||||
/* jReadRegister32Ex - Read Register Value to Slave (via CAN) with Result */
|
||||
int jReadRegister32Ex(uint8_t slave,uint16_t parm,void *pValue,uint8_t* type);
|
||||
int jReadRegister32Exl(uint8_t slave,uint16_t parm,int32_t *value);
|
||||
int jReadRegister32Exd(uint8_t slave,uint16_t parm,float *value);
|
||||
|
||||
|
||||
/* Bit Manipulationen */
|
||||
void jSetRegisterBit(uint8_t slave,uint16_t parm,uint8_t bit);
|
||||
void jClearRegisterBit(uint8_t slave,uint16_t parm,uint8_t bit);
|
||||
int jReadRegisterBit(uint8_t slave,uint16_t parm,uint8_t bit);
|
||||
|
||||
/* JM2XX Command */
|
||||
int jCommand(uint8_t slave,uint32_t command);
|
||||
|
||||
/** Initialization **/
|
||||
int jcan_setup_bus(jSetCModeCallback cmodecallback);
|
||||
int jcan_num_slaves(void);
|
||||
JSlave* jcan_slave(uint8_t num);
|
||||
|
||||
int jcan_lock(void);
|
||||
int jcan_unlock(void);
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
#include <hf3/jm2xx.h>
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* rb2/can.h CAN Bus Unterstützung für regbus2
|
||||
*
|
||||
* (c) 2016 Harald Christian Joachim Wolff
|
||||
*
|
||||
**/
|
||||
|
||||
#include <rb2/regbus.h>
|
||||
|
||||
#define RB2_CANLINK_IDDEPTH 8
|
||||
|
||||
struct rb2_can_link {
|
||||
RB2_LINK link;
|
||||
|
||||
uint16_t idmasks[RB2_CANLINK_IDDEPTH];
|
||||
|
||||
CANREQUEST *canrx[2];
|
||||
};
|
||||
|
|
@ -0,0 +1,410 @@
|
|||
/**
|
||||
* candevice.c
|
||||
* @param config
|
||||
*/
|
||||
|
||||
#include <can/can.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/cpu.h>
|
||||
#include <sys/systick.h>
|
||||
|
||||
#include <hwo/bits.h>
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
// How many mailboxes to use for RX
|
||||
#define CAN_RX_MAILBOXES 12
|
||||
|
||||
|
||||
static _can_device_t
|
||||
device;
|
||||
|
||||
int can_prepare_mailbox_rx(int mailbox);
|
||||
|
||||
uint32_t can_get_device_config(void){
|
||||
return device.setup;
|
||||
};
|
||||
|
||||
int can_init_device(uint32_t config,int rxpool_length) {
|
||||
uint8_t n,i;
|
||||
|
||||
memset( &device, 0x00, sizeof(device) );
|
||||
|
||||
list_init( &(device.tx_queue) );
|
||||
|
||||
for (n=0;n<16;n++)
|
||||
{
|
||||
CANPAGE = (n << 4);
|
||||
|
||||
CANCDMOB= 0x00;
|
||||
CANSTMOB= 0x00;
|
||||
CANIDT1 = 0x00;
|
||||
CANIDT2 = 0x00;
|
||||
CANIDT3 = 0x00;
|
||||
CANIDT4 = 0x00;
|
||||
CANIDM1 = 0x00;
|
||||
CANIDM2 = 0x00;
|
||||
CANIDM3 = 0x00;
|
||||
CANIDM4 = 0x00;
|
||||
CANSTMH = 0x00;
|
||||
CANSTML = 0x00;
|
||||
|
||||
for (i=0;i<8;i++)
|
||||
CANMSG = 0x00;
|
||||
};
|
||||
|
||||
CANGCON = _BV(SWRES);
|
||||
|
||||
device.setup = config;
|
||||
device.rxpool = malloc( sizeof(canframe_t) * rxpool_length );
|
||||
if (device.rxpool == NULL){
|
||||
return -ENOMEM;
|
||||
};
|
||||
memset( device.rxpool, 0x00, sizeof(canframe_t) * rxpool_length );
|
||||
device.rxpool_length = rxpool_length;
|
||||
|
||||
switch (__freq_cpu)
|
||||
{
|
||||
case 16000000:
|
||||
switch (config & CAN_SPEED_MASK)
|
||||
{
|
||||
case CAN_1MBIT:
|
||||
CANBT1 = 0x02;
|
||||
CANBT2 = 0x04;
|
||||
CANBT3 = 0x13;
|
||||
break;
|
||||
case CAN_125KBIT:
|
||||
CANBT1 = 0x0E;
|
||||
CANBT2 = 0x0C;
|
||||
CANBT3 = 0x37;
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case 8000000:
|
||||
switch (config & CAN_SPEED_MASK)
|
||||
{
|
||||
case CAN_1MBIT:
|
||||
CANBT1 = 0x00;
|
||||
CANBT2 = 0x04;// 0x04;
|
||||
CANBT3 = 0x12; //0x12;
|
||||
break;
|
||||
case CAN_125KBIT:
|
||||
CANBT1 = 0x0E; //0x06;
|
||||
CANBT2 = 0x04; //0x0c;
|
||||
CANBT3 = 0x13; //0x37;
|
||||
break;
|
||||
};
|
||||
break;
|
||||
};
|
||||
|
||||
CANTCON = CANBT1;
|
||||
|
||||
CANGIE = _BV(ENIT) | _BV(ENRX) | _BV(ENTX) | _BV(ENERR);
|
||||
CANIE1 = 0x7F;
|
||||
CANIE2 = 0xFF;
|
||||
|
||||
CANGCON |= _BV(ENASTB);
|
||||
|
||||
{
|
||||
ATOMIC
|
||||
|
||||
for (n=0; n < CAN_RX_MAILBOXES; n++){
|
||||
can_prepare_mailbox_rx(n);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CANPAGE = 0;
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
|
||||
|
||||
static inline uint32_t canid_to_register(canid_t* cid){
|
||||
bits32_t raw;
|
||||
|
||||
raw.ui32 = cid->addr;
|
||||
|
||||
if (cid->ide){
|
||||
raw.ui32 <<= 3;
|
||||
} else
|
||||
{
|
||||
raw.ui32 <<= 21;
|
||||
};
|
||||
|
||||
if (cid->rtr) {
|
||||
raw.ui8[0] |= _BV(RTRTAG);
|
||||
};
|
||||
|
||||
return raw.ui32;
|
||||
};
|
||||
|
||||
static inline void canid_from_register(canid_t* cid){
|
||||
bits32_t raw;
|
||||
|
||||
raw.ui32 = CANIDT;
|
||||
|
||||
cid->ide = (CANCDMOB & _BV(IDE)) ? 1 : 0;
|
||||
if (cid->ide){
|
||||
cid->addr = raw.ui32 >> 3;
|
||||
} else {
|
||||
cid->addr = raw.ui16[1] >> 5;
|
||||
};
|
||||
cid->rtr = (raw.ui8[0] & _BV(RTRTAG)) ? 1 : 0;
|
||||
cid->reserved = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief test canframe for matching canfilter criteria
|
||||
* @param filter canfilter to be used for test
|
||||
* @param frame frame to be tested
|
||||
* @return 1 if filter matches frame, 0 if no match
|
||||
*/
|
||||
static inline int can_filter_match(canfilter_t *filter,canframe_t *frame){
|
||||
canid_t id1,id2;
|
||||
|
||||
id1.value = filter->id.value & filter->mask.value;
|
||||
id2.value = frame->id.value & filter->mask.value;
|
||||
|
||||
return (id1.value == id2.value) ? 1 : 0;
|
||||
};
|
||||
|
||||
int can_prepare_mailbox_rx(int mailbox) {
|
||||
|
||||
ATOMIC
|
||||
|
||||
if (mailbox < 15)
|
||||
{
|
||||
CANPAGE = mailbox << 4;
|
||||
|
||||
CANSTMOB = 0x00;
|
||||
CANCDMOB = 0x00;
|
||||
|
||||
CANIDT = 0;
|
||||
CANIDM = 0;
|
||||
|
||||
CANCDMOB = _BV(CONMOB1);
|
||||
|
||||
} else {
|
||||
return -EPARAM;
|
||||
};
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief copy frame to frame_t* from hardware registers
|
||||
* @param frame target frame_t
|
||||
* @return 0 on success
|
||||
*/
|
||||
int can_frame_from_mailbox(canframe_t *frame){
|
||||
uint8_t n;
|
||||
|
||||
frame->frame_id = device.frame_id_rx++;
|
||||
frame->flags.len = (CANCDMOB & 0x0F);
|
||||
canid_from_register( &(frame->id) );
|
||||
|
||||
|
||||
for (n=0;n<8;n++){
|
||||
frame->payload.bytes[n] = CANMSG;
|
||||
};
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
int can_next_frame_tx(void){
|
||||
canframe_t *frame = list_first_entry( &(device.tx_queue), canframe_t, list );
|
||||
|
||||
uint8_t tmp = CANPAGE;
|
||||
CANPAGE = (14 << 4);
|
||||
|
||||
CANSTMOB = 0x00;
|
||||
CANCDMOB = 0x00;
|
||||
|
||||
if (frame){
|
||||
uint8_t n;
|
||||
|
||||
CANCDMOB = (frame->flags.len & 0x0f) | (frame->id.ide ? _BV(IDE) : 0);
|
||||
|
||||
CANIDT = canid_to_register( &frame->id );
|
||||
for (n=0;n<8;n++){
|
||||
CANMSG = frame->payload.bytes[n];
|
||||
};
|
||||
|
||||
CANCDMOB |= _BV(CONMOB0);
|
||||
};
|
||||
|
||||
CANPAGE = tmp;
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
|
||||
void can_vect(void){
|
||||
uint16_t sit = CANSIT2 | (CANSIT1 << 8);
|
||||
uint8_t n;
|
||||
|
||||
uint8_t cptemp = CANPAGE;
|
||||
|
||||
if (sit & 0x7FFF)
|
||||
{
|
||||
for (n=0;n<15;n++)
|
||||
{
|
||||
if (sit & _BV(n))
|
||||
{
|
||||
CANPAGE = (n << 4);
|
||||
CANCDMOB &= ~(_BV(CONMOB0) | _BV(CONMOB1));
|
||||
|
||||
if (n < CAN_RX_MAILBOXES){
|
||||
if (CANSTMOB & 0x1F) {
|
||||
// Ein Fehler trat auf
|
||||
|
||||
} else {
|
||||
// Empfangen
|
||||
can_frame_from_mailbox( &(device.rxpool[ device.rxpool_next++ ]) );
|
||||
|
||||
if (device.rxpool_next >= device.rxpool_length){
|
||||
device.rxpool_next = 0;
|
||||
};
|
||||
};
|
||||
can_prepare_mailbox_rx(n);
|
||||
|
||||
} else if (n == 14) {
|
||||
|
||||
canframe_t* tx = list_first_entry( &(device.tx_queue), canframe_t, list);
|
||||
if (tx){
|
||||
tx->frame_id = device.frame_id_tx++;
|
||||
tx->flags.error = (CANSTMOB & 0x1F) ? 1 : 0;
|
||||
tx->flags.tx = 0;
|
||||
list_remove( &(tx->list) );
|
||||
thread_wake( tx->notify );
|
||||
};
|
||||
can_next_frame_tx();
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
CANPAGE = cptemp;
|
||||
};
|
||||
|
||||
|
||||
VECT(CANIT_vect){
|
||||
can_vect();
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* USER API */
|
||||
|
||||
int can_send(canframe_t *frame){
|
||||
if (frame){
|
||||
ATOMIC
|
||||
|
||||
int empty = list_is_empty( &(device.tx_queue) );
|
||||
|
||||
frame->notify = current_thread();
|
||||
list_append( &(frame->list ), &(device.tx_queue) );
|
||||
|
||||
if (empty){
|
||||
can_next_frame_tx();
|
||||
};
|
||||
|
||||
wait_ms( 10 );
|
||||
|
||||
if (!list_is_empty( &(frame->list) ) ){
|
||||
list_remove( &(frame->list) );
|
||||
};
|
||||
|
||||
if (frame->flags.tx || frame->flags.error){
|
||||
return -EFAIL;
|
||||
};
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
return -EFAIL;
|
||||
};
|
||||
|
||||
int can_send_simple(canid_t cid,uint8_t len,canpayload_t payload){
|
||||
canframe_t *frame = malloc(sizeof(canframe_t));
|
||||
int r;
|
||||
|
||||
if (frame){
|
||||
memset( frame, 0x00, sizeof(canframe_t) );
|
||||
frame->flags.tx = 1;
|
||||
frame->flags.len = len;
|
||||
frame->id = cid;
|
||||
frame->payload = payload;
|
||||
|
||||
r = can_send( frame );
|
||||
|
||||
free(frame);
|
||||
|
||||
return r;
|
||||
} else {
|
||||
return -ENOMEM;
|
||||
}
|
||||
};
|
||||
|
||||
int can_recv(canfilter_t *filter,canframe_t *frame){
|
||||
ATOMIC
|
||||
|
||||
int n;
|
||||
|
||||
if (!frame){
|
||||
return -ENULLPTR;
|
||||
}
|
||||
|
||||
n = device.rxpool_next;
|
||||
do {
|
||||
if ((device.rxpool[n].frame_id > filter->last_seen_frame_id) || (n < device.rxpool_next)){
|
||||
|
||||
if (can_filter_match( filter, &(device.rxpool[n]) )){
|
||||
*frame = device.rxpool[n];
|
||||
|
||||
filter->last_seen_frame_id = frame->frame_id;
|
||||
|
||||
memset( &device.rxpool[n], 0x00, sizeof(canframe_t) );
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
filter->last_seen_frame_id = device.rxpool[n].frame_id;
|
||||
|
||||
n++;
|
||||
if (n == device.rxpool_length){
|
||||
n = 0;
|
||||
};
|
||||
|
||||
} while (device.rxpool_next != n);
|
||||
|
||||
return -EFAIL;
|
||||
};
|
||||
|
||||
int can_recv_timeout(canfilter_t *filter,canframe_t *frame,int ms){
|
||||
int n,r;
|
||||
|
||||
for (n = 0; n < ms; n++){
|
||||
r = can_recv( filter, frame );
|
||||
if (r == ESUCCESS){
|
||||
return ESUCCESS;
|
||||
};
|
||||
wait_ms(1);
|
||||
};
|
||||
|
||||
return -ETIMEOUT;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
#include <can/cannode.h>
|
||||
#include <can/can.h>
|
||||
|
||||
#include <sys/errno.h>
|
||||
#include <sys/assert.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
cannode_t* can_node_create(int identity,register_node_proc node_proc){
|
||||
cannode_t* cn = malloc(sizeof(cannode_t));
|
||||
if (cn){
|
||||
memset(cn,0x00,sizeof(cannode_t));
|
||||
|
||||
cn->identity = identity & 0x0F;
|
||||
cn->node_proc = node_proc;
|
||||
cn->rxfilter = (canfilter_t){
|
||||
id: {
|
||||
addr: ((int32_t)cn->identity) << 20,
|
||||
ide: 1
|
||||
},
|
||||
mask: {
|
||||
addr: 0x1FFF0000l,
|
||||
ide: 1
|
||||
}
|
||||
};
|
||||
};
|
||||
return cn;
|
||||
};
|
||||
|
||||
int can_node_received(cannode_t *cn,canframe_t *frame){
|
||||
unsigned int regno = frame->id.addr & 0xffff;
|
||||
|
||||
if (frame->id.rtr){
|
||||
|
||||
if (!cn->node_proc( RNPOP_READ, regno, &(frame->payload.bytes[4]), &(frame->payload.dwords[0]) )){
|
||||
|
||||
frame->id.rtr = 0;
|
||||
frame->flags.len = 5;
|
||||
|
||||
assert( can_send( frame ) );
|
||||
|
||||
};
|
||||
} else if (frame->flags.len == 2){
|
||||
int i;
|
||||
|
||||
for (i=regno;i < (regno+frame->payload.words[0]); i++){
|
||||
|
||||
if (!cn->node_proc( RNPOP_READ, regno, &(frame->payload.bytes[4]), &(frame->payload.dwords[0]) )){
|
||||
|
||||
frame->id.rtr = 0;
|
||||
frame->id.addr = (((int32_t)cn->identity) << 20)|(regno);
|
||||
frame->flags.len = 5;
|
||||
|
||||
assert( can_send( frame ) );
|
||||
};
|
||||
};
|
||||
} else if (frame->flags.len == 6){
|
||||
cn->node_proc( RNPOP_WRITE, regno, &(frame->payload.bytes[4]), &(frame->payload.dwords[0]) );
|
||||
|
||||
frame->id.rtr = 0;
|
||||
frame->flags.len = 5;
|
||||
|
||||
assert( can_send( frame ) );
|
||||
};
|
||||
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
int can_node_handler(cannode_t *cn){
|
||||
canframe_t frame;
|
||||
|
||||
if (cn == NULL){
|
||||
return -ENULLPTR;
|
||||
};
|
||||
|
||||
while (!can_recv(&(cn->rxfilter),&frame)){
|
||||
assert( can_node_received( cn, &frame ) );
|
||||
};
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
|
||||
int can_node_read (int node,unsigned int reg,uint8_t *type,void *buffer){
|
||||
canframe_t frame;
|
||||
canfilter_t f;
|
||||
|
||||
node &= 0x0f;
|
||||
|
||||
memset( &frame, 0x00, sizeof(frame) );
|
||||
frame.id.addr = (((uint32_t)node)<<20) | (reg);
|
||||
frame.id.ide = 1;
|
||||
frame.id.rtr = 1;
|
||||
frame.flags.len = 1;
|
||||
frame.flags.tx = 1;
|
||||
|
||||
assert( can_send( &frame ) );
|
||||
|
||||
f = (canfilter_t){
|
||||
id: {
|
||||
addr: (((int32_t)node) << 20) | (reg),
|
||||
ide: 1
|
||||
},
|
||||
mask: {
|
||||
addr: 0x1FFFFFFFl,
|
||||
ide: 1,
|
||||
rtr: 1
|
||||
}
|
||||
};
|
||||
|
||||
*(int32_t*)buffer = 0;
|
||||
|
||||
assert( can_recv_timeout( &f, &frame, 10 ));
|
||||
|
||||
*(int32_t*)buffer = frame.payload.dwords[0];
|
||||
*type = frame.payload.bytes[4];
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
int can_node_write (int node,unsigned int reg,uint8_t type,void *buffer){
|
||||
canframe_t frame;
|
||||
|
||||
memset( &frame, 0x00, sizeof(frame) );
|
||||
frame.id.addr = (((int32_t)node)<<20) | (reg);
|
||||
frame.id.ide = 1;
|
||||
frame.id.rtr = 0;
|
||||
frame.flags.len = 6;
|
||||
frame.payload.dwords[0] = *(uint32_t*)buffer;
|
||||
frame.payload.bytes[4] = type;
|
||||
|
||||
can_send( &frame );
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
|
@ -0,0 +1,348 @@
|
|||
#include <sys/assert.h>
|
||||
#include <sys/atomic.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
#include <can/can.h>
|
||||
#include <can/jetcan.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <avr/eeprom.h>
|
||||
|
||||
#include <sys/runtime.h>
|
||||
|
||||
int32_t _dbg_jetcan_requests,
|
||||
_dbg_jetcan_misses,
|
||||
_dbg_jetcan_timeouts,
|
||||
_dbg_jetcan_rtt,
|
||||
_dbg_jetcan_rtt_min = 0x7FFFFFFFl,
|
||||
_dbg_jetcan_rtt_max;
|
||||
|
||||
|
||||
struct _jetcan jetcan;
|
||||
|
||||
static canfilter_t
|
||||
cf_jetcan_reply =
|
||||
{
|
||||
id: {
|
||||
addr: 0x100
|
||||
},
|
||||
mask: {
|
||||
addr: 0x7FF,
|
||||
ide: 1
|
||||
}
|
||||
};
|
||||
|
||||
#define IS_1MBIT ((can_get_device_config()&CAN_SPEED_MASK)==CAN_1MBIT)
|
||||
#define IS_125KBIT ((can_get_device_config()&CAN_SPEED_MASK)==CAN_125KBIT)
|
||||
|
||||
|
||||
int jcan_lock(void){
|
||||
mutex_lock( &jetcan.lock );
|
||||
return ESUCCESS;
|
||||
};
|
||||
int jcan_unlock(void){
|
||||
mutex_release( &jetcan.lock );
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
JSlave* jcan_slave(uint8_t num)
|
||||
{
|
||||
if (num < jetcan.nSlaves){
|
||||
return &jetcan.slaves[num];
|
||||
};
|
||||
return NULL;
|
||||
};
|
||||
|
||||
int jcan_num_slaves(void)
|
||||
{
|
||||
return jetcan.nSlaves;
|
||||
};
|
||||
|
||||
|
||||
int jcan_setup_bus(jSetCModeCallback cmodecallback)
|
||||
{
|
||||
canfilter_t rxfilter = {
|
||||
id: {
|
||||
addr: 0x160
|
||||
},
|
||||
mask: {
|
||||
addr: 0x7FF,
|
||||
ide: 1
|
||||
}
|
||||
};
|
||||
|
||||
canframe_t *mid_frame,
|
||||
*stp_frame;
|
||||
|
||||
mid_frame = malloc( sizeof(canframe_t) );
|
||||
if (!mid_frame){
|
||||
return -ENOMEM;
|
||||
};
|
||||
stp_frame = malloc( sizeof(canframe_t) );
|
||||
if (!stp_frame){
|
||||
free(mid_frame);
|
||||
return -ENOMEM;
|
||||
};
|
||||
|
||||
jcan_lock();
|
||||
|
||||
jetcan.nSlaves = 0;
|
||||
|
||||
cmodecallback(0x00);
|
||||
wait_ms(250);
|
||||
|
||||
if (IS_1MBIT){
|
||||
cmodecallback(0x01);
|
||||
} else if (IS_125KBIT){
|
||||
cmodecallback(0x02);
|
||||
};
|
||||
|
||||
do
|
||||
{
|
||||
if (!can_recv_timeout(&rxfilter, stp_frame, 100)){
|
||||
|
||||
memset( &jetcan.slaves[jetcan.nSlaves],
|
||||
0x00,
|
||||
sizeof(JSlave));
|
||||
|
||||
jetcan.slaves[ jetcan.nSlaves ].refID = (0x0161 + jetcan.nSlaves);
|
||||
jetcan.slaves[ jetcan.nSlaves ].modcode = stp_frame->payload.bytes[0];
|
||||
|
||||
*mid_frame = (canframe_t){
|
||||
flags: {
|
||||
tx: 1,
|
||||
len: 2
|
||||
},
|
||||
id: {
|
||||
addr: 0x0161,
|
||||
},
|
||||
payload: {
|
||||
words: {
|
||||
jetcan.slaves[ jetcan.nSlaves ].refID,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
can_send( mid_frame );
|
||||
|
||||
jetcan.nSlaves++;
|
||||
|
||||
continue;
|
||||
};
|
||||
|
||||
} while (0);
|
||||
|
||||
cmodecallback(0x03);
|
||||
|
||||
jcan_unlock();
|
||||
|
||||
free( mid_frame );
|
||||
free( stp_frame );
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
int jReadRegister32Ex(uint8_t slave,uint16_t parm,void *pValue,uint8_t *type)
|
||||
{
|
||||
JSlave *sl;
|
||||
uint32_t *pui32 = (uint32_t*)pValue;
|
||||
int retries = 3;
|
||||
canframe_t req,reply;
|
||||
systick_t st_start;
|
||||
|
||||
MUTEXED( &(jetcan.lock) );
|
||||
|
||||
if (!parm){
|
||||
return -EPARAM;
|
||||
};
|
||||
|
||||
_dbg_jetcan_requests++;
|
||||
st_start = systick_ticks();
|
||||
|
||||
*pui32 = 0;
|
||||
|
||||
while (!can_recv(&cf_jetcan_reply, &reply));
|
||||
|
||||
while (retries--){
|
||||
sl = jcan_slave(slave);
|
||||
if (sl){
|
||||
|
||||
req = (canframe_t){
|
||||
flags: { tx: 1, len: 3 },
|
||||
id: { addr: sl->refID },
|
||||
payload: {
|
||||
words: {
|
||||
parm,
|
||||
*type
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
can_send( &req );
|
||||
|
||||
if (can_recv_timeout( &cf_jetcan_reply, &reply, 25 ) == 0){
|
||||
*pui32 = reply.payload.dwords[0];
|
||||
*type = reply.payload.bytes[4];
|
||||
|
||||
st_start = systick_ticks() - st_start;
|
||||
_dbg_jetcan_rtt += st_start;
|
||||
_dbg_jetcan_rtt -= _dbg_jetcan_rtt >> 4;
|
||||
|
||||
if (_dbg_jetcan_rtt_min > st_start)
|
||||
_dbg_jetcan_rtt_min = st_start;
|
||||
|
||||
if (_dbg_jetcan_rtt_max < st_start)
|
||||
_dbg_jetcan_rtt_max = st_start;
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
_dbg_jetcan_misses++;
|
||||
};
|
||||
};
|
||||
|
||||
_dbg_jetcan_timeouts++;
|
||||
|
||||
return -EBUSY;
|
||||
};
|
||||
|
||||
int jReadRegister32Exl(uint8_t slave,uint16_t parm,int32_t *value)
|
||||
{
|
||||
uint8_t type = J_LONG;
|
||||
int r;
|
||||
|
||||
r = jReadRegister32Ex(slave,parm,value,&type);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
if (type != J_LONG)
|
||||
*value = (int32_t)(*(float*)value);
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
int jReadRegister32Exd(uint8_t slave,uint16_t parm,float *value)
|
||||
{
|
||||
uint8_t type = J_FLOAT;
|
||||
int r;
|
||||
|
||||
r = jReadRegister32Ex(slave,parm,value,&type);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
if (type != J_FLOAT)
|
||||
*value = (float)*(int32_t*)value;
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
int jSetRegister32Ex(uint8_t slave,uint16_t parm,void *pValue,uint8_t type){
|
||||
JSlave *sl;
|
||||
uint16_t *pw16 = (uint16_t*)pValue;
|
||||
int retries = 3;
|
||||
canframe_t req,reply;
|
||||
systick_t st_start;
|
||||
MUTEXED( &(jetcan.lock) );
|
||||
|
||||
if (!parm){
|
||||
return -EPARAM;
|
||||
};
|
||||
|
||||
_dbg_jetcan_requests++;
|
||||
st_start = systick_ticks();
|
||||
|
||||
while (!can_recv(&cf_jetcan_reply, &reply));
|
||||
|
||||
while (retries--){
|
||||
sl = jcan_slave(slave);
|
||||
if (sl){
|
||||
|
||||
req = (canframe_t){
|
||||
flags: { tx: 1, len: 7 },
|
||||
id: { addr: sl->refID },
|
||||
payload: {
|
||||
words: {
|
||||
parm,
|
||||
pw16[0],
|
||||
pw16[1],
|
||||
type
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
can_send( &req );
|
||||
|
||||
if (can_recv_timeout( &cf_jetcan_reply, &reply, 10 ) == 0){
|
||||
|
||||
st_start = systick_ticks() - st_start;
|
||||
_dbg_jetcan_rtt += st_start;
|
||||
_dbg_jetcan_rtt -= _dbg_jetcan_rtt >> 4;
|
||||
|
||||
if (_dbg_jetcan_rtt_min > st_start)
|
||||
_dbg_jetcan_rtt_min = st_start;
|
||||
|
||||
if (_dbg_jetcan_rtt_max < (int32_t)st_start)
|
||||
_dbg_jetcan_rtt_max = st_start;
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
_dbg_jetcan_misses++;
|
||||
};
|
||||
};
|
||||
|
||||
_dbg_jetcan_timeouts++;
|
||||
|
||||
return -EBUSY;
|
||||
};
|
||||
|
||||
int jSetRegister32Exl(uint8_t slave,uint16_t parm,int32_t value)
|
||||
{
|
||||
return jSetRegister32Ex(slave,parm,&value,J_LONG);
|
||||
};
|
||||
int jSetRegister32Exd(uint8_t slave,uint16_t parm,float value)
|
||||
{
|
||||
return jSetRegister32Ex(slave,parm,&value,J_FLOAT);
|
||||
};
|
||||
|
||||
/* Bit Manipulationen */
|
||||
void jSetRegisterBit(uint8_t slave,uint16_t parm,uint8_t bit)
|
||||
{
|
||||
int32_t v;
|
||||
|
||||
if (jReadRegister32Exl(slave, parm, &v))
|
||||
{
|
||||
v |= (1<<bit);
|
||||
jSetRegister32Exl(slave,parm,v);
|
||||
};
|
||||
};
|
||||
|
||||
void jClearRegisterBit(uint8_t slave,uint16_t parm,uint8_t bit)
|
||||
{
|
||||
int32_t v;
|
||||
|
||||
if (jReadRegister32Exl(slave, parm, &v))
|
||||
{
|
||||
v &= ~(1<<bit);
|
||||
jSetRegister32Exl(slave,parm,v);
|
||||
};
|
||||
};
|
||||
|
||||
int jReadRegisterBit(uint8_t slave,uint16_t parm,uint8_t bit)
|
||||
{
|
||||
int32_t v;
|
||||
|
||||
if (jReadRegister32Exl(slave, parm, &v))
|
||||
{
|
||||
if (v & (1<<bit))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
};
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
#include <can/can.h>
|
||||
#include <rb2/regbus.h>
|
||||
|
||||
typedef struct {
|
||||
RB2_LINK link;
|
||||
|
||||
uint16_t axes_on_can;
|
||||
uint16_t nodes_on_can;
|
||||
|
||||
canframe_t rxframe;
|
||||
canframe_t txframe;
|
||||
|
||||
canfilter_t filter_rx;
|
||||
|
||||
list_t pool;
|
||||
|
||||
} rb2_canlink_t;
|
||||
|
||||
rb2_telegram_buffer_t * rb2_can_receive (RB2_LINK *link);
|
||||
uint8_t rb2_can_send (RB2_LINK *link,rb2_telegram_buffer_t *telegram);
|
||||
|
||||
|
||||
rb2_canlink_t
|
||||
*rb2_canlink;
|
||||
|
||||
|
||||
RB2_LINK* rb2_create_can_link(void){
|
||||
|
||||
if (rb2_canlink){
|
||||
return &(rb2_canlink->link);
|
||||
};
|
||||
|
||||
rb2_canlink = malloc(sizeof(rb2_canlink_t));
|
||||
if (rb2_canlink){
|
||||
|
||||
memset(rb2_canlink, 0x00, sizeof(rb2_canlink_t));
|
||||
|
||||
rb2_canlink->filter_rx.id = (canid_t){
|
||||
ide: 1,
|
||||
addr: (1L<<25)
|
||||
};
|
||||
rb2_canlink->filter_rx.mask = (canid_t){
|
||||
ide: 1,
|
||||
addr: 0x1EFF0000
|
||||
};
|
||||
|
||||
};
|
||||
return &(rb2_canlink->link);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
rb2_telegram_buffer_t* rb2_can_receive (RB2_LINK *link){
|
||||
|
||||
|
||||
return NULL;
|
||||
};
|
||||
|
||||
uint8_t rb2_can_send (RB2_LINK *link,rb2_telegram_buffer_t *telegram){
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
#include <rb2/regbus.h>
|
||||
#include <hwo/threads.h>
|
||||
|
||||
#include <can/can.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
int32_t dbg_rb2_can_tx;
|
||||
int32_t dbg_rb2_can_rx;
|
||||
int32_t dbg_rb2_can_rx_err;
|
||||
int16_t dbg_rb2_can_rx_ptr[2];
|
||||
|
||||
RB2_CAN_LINK *rb2_can_link;
|
||||
|
||||
void rb2_can_prepare_rx(CANREQUEST *can);
|
||||
void rb2_can_irq_tx(CANREQUEST *request);
|
||||
|
||||
rb2_telegram_buffer_t* rb2_can_receive (RB2_LINK *link);
|
||||
uint8_t rb2_can_send (RB2_LINK *link,rb2_telegram_buffer_t *telegram);
|
||||
|
||||
void rb2_can_irq_rx(CANREQUEST *request);
|
||||
|
||||
RB2_LINK* rb2_create_can_link(void) {
|
||||
if (rb2_can_link)
|
||||
return &(rb2_can_link->link);
|
||||
|
||||
rb2_can_link = malloc( sizeof( RB2_CAN_LINK ) );
|
||||
|
||||
if (rb2_can_link) {
|
||||
uint8_t n;
|
||||
|
||||
memset( rb2_can_link, 0x00, sizeof( RB2_CAN_LINK ) );
|
||||
|
||||
rb2_can_link->link.receive = NULL;
|
||||
rb2_can_link->link.send = rb2_can_send;
|
||||
|
||||
for (n=0;n<2;n++) {
|
||||
rb2_can_link->canrx[n] = malloc( sizeof(CANREQUEST) );
|
||||
if (rb2_can_link->canrx[n]) {
|
||||
rb2_can_prepare_rx( rb2_can_link->canrx[n] );
|
||||
can_enqueue( rb2_can_link->canrx[n] );
|
||||
};
|
||||
};
|
||||
|
||||
list_append( &(rb2_can_link->link.list), &((&__rb2_instance)->links.list) );
|
||||
|
||||
return &(rb2_can_link->link);
|
||||
};
|
||||
return NULL;
|
||||
};
|
||||
|
||||
void rb2_can_prepare_rx(CANREQUEST *can) {
|
||||
if (can) {
|
||||
memset( can, 0x00, sizeof( CANREQUEST ) );
|
||||
|
||||
can->ide = 1;
|
||||
can->idmask.id = 0x1FFF0000L;
|
||||
can->id.id = 0x00080000L;
|
||||
can->irq_notify = rb2_can_irq_rx;
|
||||
};
|
||||
};
|
||||
|
||||
uint8_t rb2_can_send (RB2_LINK *link,rb2_telegram_buffer_t *telegram) {
|
||||
CANREQUEST *can = malloc( sizeof(CANREQUEST) );
|
||||
uint8_t n;
|
||||
|
||||
if (can) {
|
||||
memset( can, 0x00, sizeof( CANREQUEST ) );
|
||||
|
||||
can->ide = 1;
|
||||
can->tx = 1;
|
||||
can->id.id = 0x00080000L |
|
||||
( ((uint32_t)(&__rb2_instance)->ax) << 12) |
|
||||
( ((uint32_t)rb2_first_id()) << 8) |
|
||||
telegram->telegram.flags.byte;
|
||||
|
||||
can->len = 8;
|
||||
can->data.bytes[0] = telegram->telegram.receiver.addr;
|
||||
can->data.bytes[1] = telegram->telegram.sender.addr;
|
||||
can->data.words[1] = telegram->telegram.regno;
|
||||
can->data.dwords[1] = telegram->telegram.ui32;
|
||||
|
||||
if (telegram->telegram.flags.ident) {
|
||||
for (n=0;n<(RB2_CANLINK_IDDEPTH-1);n++){
|
||||
RB2_CAN_LINK(link)->idmasks[ n ] = RB2_CAN_LINK(link)->idmasks[ n + 1 ];
|
||||
};
|
||||
RB2_CAN_LINK(link)->idmasks[n] = 0;
|
||||
};
|
||||
|
||||
can->irq_notify = rb2_can_irq_tx;
|
||||
|
||||
if (can_enqueue( can )){
|
||||
free( can );
|
||||
return -1;
|
||||
} else {
|
||||
if (_dbg_trace_rb2_can_tx)
|
||||
_dbg_trace_rb2_can_tx( telegram );
|
||||
};
|
||||
};
|
||||
free(telegram);
|
||||
return 0;
|
||||
};
|
||||
|
||||
void rb2_can_irq_tx(CANREQUEST *request){
|
||||
dbg_rb2_can_tx++;
|
||||
|
||||
free(request);
|
||||
};
|
||||
|
||||
void rb2_can_irq_rx(CANREQUEST *request){
|
||||
RB2_CAN_LINK *clink = rb2_can_link;
|
||||
rb2_telegram_buffer_t *t = NULL;
|
||||
uint8_t n;
|
||||
|
||||
dbg_rb2_can_rx_ptr[ 1 ] = dbg_rb2_can_rx_ptr[ 0 ];
|
||||
dbg_rb2_can_rx_ptr[ 0 ] = (int16_t)request;
|
||||
|
||||
if (!request->err) {
|
||||
|
||||
t = malloc( sizeof(rb2_telegram_buffer_t) );
|
||||
|
||||
if (t) {
|
||||
memset( t, 0x00, sizeof(rb2_telegram_buffer_t) );
|
||||
|
||||
t->telegram.flags.byte = request->id.id & 0x000000FF;
|
||||
t->telegram.receiver.addr = request->data.bytes[0];
|
||||
t->telegram.sender.addr = request->data.bytes[1];
|
||||
t->telegram.regno = request->data.words[1];
|
||||
t->telegram.ui32 = request->data.dwords[1];
|
||||
|
||||
if (t->telegram.flags.ident) {
|
||||
for (n=0;n<RB2_CANLINK_IDDEPTH;n++){
|
||||
clink->idmasks[n] |= t->telegram.endpoints;
|
||||
};
|
||||
t->telegram.endpoints = clink->idmasks[0];
|
||||
} else {
|
||||
if (
|
||||
((&__rb2_instance)->ax == t->telegram.receiver.ax) &&
|
||||
(clink->link.idmask & (1<<t->telegram.receiver.node))
|
||||
){
|
||||
free( t );
|
||||
t = NULL;
|
||||
};
|
||||
};
|
||||
|
||||
if (t){
|
||||
dbg_rb2_can_rx++;
|
||||
|
||||
t->link = &(rb2_can_link->link);
|
||||
|
||||
if (_dbg_trace_rb2_can_rx)
|
||||
_dbg_trace_rb2_can_rx( t );
|
||||
|
||||
rb2_route_listed( t );
|
||||
};
|
||||
};
|
||||
} else {
|
||||
dbg_rb2_can_rx_err++;
|
||||
};
|
||||
|
||||
rb2_can_prepare_rx( request );
|
||||
|
||||
if (!can_enqueue( request )){
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
uint16_t getPC(void);
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
unsigned char crc8 (const unsigned char *pData,
|
||||
unsigned char ByteCount,
|
||||
unsigned char StartVal);
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <fixpoint/fp1616.h>
|
||||
#include <fixpoint/fp4816.h>
|
||||
|
||||
#include <fixpoint/pid.h>
|
|
@ -0,0 +1,50 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define FP1616_FRAC 16
|
||||
|
||||
union fp1616{
|
||||
int32_t value;
|
||||
uint32_t uvalue;
|
||||
struct {
|
||||
int16_t decimal;
|
||||
int16_t predecimal;
|
||||
};
|
||||
};
|
||||
typedef union fp1616 fp1616_t;
|
||||
#define fp1616(v) ((fp1616_t){value: v})
|
||||
|
||||
|
||||
static inline fp1616_t fp1616_add ( fp1616_t a, fp1616_t b ) { return fp1616( a.value + b.value); };
|
||||
static inline fp1616_t fp1616_sub ( fp1616_t a, fp1616_t b ) { return fp1616( a.value - b.value); };
|
||||
static inline fp1616_t fp1616_mul ( fp1616_t a, fp1616_t b ) { return fp1616( ((int64_t)a.value * (int64_t)b.value) >> FP1616_FRAC ); };
|
||||
static inline fp1616_t fp1616_div ( fp1616_t a, fp1616_t b ) { return fp1616( ((int64_t)a.value << FP1616_FRAC) / b.value ); };
|
||||
|
||||
#define fp1616_eq(a,b) ((a.value == b.value))
|
||||
#define fp1616_lt(a,b) ((a.value < b.value))
|
||||
#define fp1616_gt(a,b) ((a.value > b.value))
|
||||
|
||||
|
||||
#define fp4816_from_1616(fp1616) ((fp4816_t)fp1616.value)
|
||||
#define fp1616_from_4816(fp4816) ((fp1616_t){value: (int32_t)fp4816 })
|
||||
|
||||
#define fp1616_from_float_c( value ) (fp1616(value * 65536.0f))
|
||||
#define fp1616_from_float(f) (fp1616(fp4816_from_float(f)))
|
||||
#define fp1616_from_int( value ) ( fp1616( (long)value << 16 ) )
|
||||
#define fp1616_to_float( fp ) ( fp4816_to_float( fp4816_from_1616(fp) ) )
|
||||
|
||||
struct _fp1616_smoother {
|
||||
fp1616_t value,
|
||||
sum,
|
||||
k;
|
||||
};
|
||||
|
||||
fp1616_t fp1616_smoother(struct _fp1616_smoother *smoother,fp1616_t sample);
|
||||
static inline void fp1616_smoother_set(struct _fp1616_smoother *smoother,fp1616_t tn) {
|
||||
if (smoother) {
|
||||
smoother->value.value = 0;
|
||||
smoother->sum.value = 0;
|
||||
smoother->k = fp1616_div(fp1616(65536),tn);
|
||||
};
|
||||
};
|
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <fixpoint/ieee.h>
|
||||
|
||||
/** \file */
|
||||
/** \defgroup fixpoint <fixpoint/fp248.h>: 24/8bit Fixpoint Support
|
||||
\code
|
||||
#include <fixpoint/fp248.h>
|
||||
\endcode
|
||||
|
||||
Function
|
||||
*/
|
||||
|
||||
typedef int32_t fp248_t;
|
||||
|
||||
|
||||
#define FP248_FRAC 8
|
||||
#define FP248_MASK (0xFFFFFFFF >> (32-FP248_FRAC))
|
||||
|
||||
float fp248_to_float (fp248_t value);
|
||||
fp248_t fp248_from_float (float value);
|
||||
|
||||
static inline fp248_t fp248_from_int32 (int32_t value) { return (fp248_t)(value << FP248_FRAC); };
|
||||
static inline int32_t fp248_to_int32 (fp248_t value) { return (int32_t)(value >> FP248_FRAC); };
|
||||
static inline fp248_t fp248_fraction (fp248_t value) { return value & FP248_MASK; };
|
||||
|
||||
static inline fp248_t fp248_add ( fp248_t a, fp248_t b ) { return a + b; };
|
||||
static inline fp248_t fp248_sub ( fp248_t a, fp248_t b ) { return a - b; };
|
||||
static inline fp248_t fp248_mul ( fp248_t a, fp248_t b ) { return (fp248_t)( ((int64_t)a * (int64_t)b) >> FP248_FRAC ); };
|
||||
static inline fp248_t fp248_div ( fp248_t a, fp248_t b ) { return (fp248_t)( ((int64_t)a << FP248_FRAC) / b ); };
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
#define FP_PI fp_make(M_PI)
|
||||
#define FP_2PI (2*FP_PI)
|
||||
|
||||
#define FP_SQRT_2 fp_make(1.414213562373095)
|
||||
#define FP_INV_SQRT_2 fp_make(0.707106781)
|
||||
#define FP_SQRT_3 fp_make(1.73205080756887729352)
|
||||
#define FP_INV_SQRT_3 fp_make(0.577350269)
|
||||
*/
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <fixpoint/ieee.h>
|
||||
|
||||
|
||||
typedef int64_t fp4816_t;
|
||||
|
||||
|
||||
#define FP4816_FRAC 16
|
||||
#define FP4816_MASK (0xFFFFFFFFFFFFFFFF >> (64-FP4816_FRAC))
|
||||
|
||||
float fp4816_to_float (fp4816_t value);
|
||||
fp4816_t fp4816_from_float (float value);
|
||||
|
||||
#define fp4816_from_float_c( value ) ((fp4816_t)(value * 65536.0f))
|
||||
|
||||
static inline fp4816_t fp4816_from_int32 (int32_t value) { return (fp4816_t)(((fp4816_t)value) << FP4816_FRAC); };
|
||||
static inline int32_t fp4816_to_int32 (fp4816_t value) { return (int32_t)(value >> 16); };
|
||||
static inline fp4816_t fp4816_fraction (fp4816_t value) { return value & FP4816_MASK; };
|
||||
|
||||
static inline fp4816_t fp4816_add ( fp4816_t a, fp4816_t b ) { return a + b; };
|
||||
static inline fp4816_t fp4816_sub ( fp4816_t a, fp4816_t b ) { return a - b; };
|
||||
static inline fp4816_t fp4816_mul ( fp4816_t a, fp4816_t b ) { return (fp4816_t)( ((int64_t)a * (int64_t)b) >> FP4816_FRAC ); };
|
||||
static inline fp4816_t fp4816_div ( fp4816_t a, fp4816_t b ) { return (fp4816_t)( ((int64_t)a << FP4816_FRAC) / b ); };
|
||||
|
||||
static inline fp4816_t fp4816_abs ( fp4816_t a ) { return (a<0) ? -a : a; };
|
||||
|
||||
fp4816_t fp4816_taylor (fp4816_t v,int lev);
|
||||
fp4816_t fp4816_sin_slow (fp4816_t rad);
|
||||
fp4816_t fp4816_taylor_element(fp4816_t v,int lev);
|
||||
fp4816_t fp4816_pow (fp4816_t v,int pow);
|
||||
|
||||
struct _fp4816_smoother {
|
||||
fp4816_t value,
|
||||
sum,
|
||||
k;
|
||||
};
|
||||
|
||||
fp4816_t fp4816_smoother(struct _fp4816_smoother *smoother,fp4816_t sample);
|
||||
static inline void fp4816_smoother_set(struct _fp4816_smoother *smoother,fp4816_t tn) {
|
||||
if (smoother) {
|
||||
smoother->value = 0;
|
||||
smoother->sum = 0;
|
||||
smoother->k = fp4816_div(65536,tn);
|
||||
};
|
||||
};
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define FP4816_PI fp4816_from_float_c(M_PI)
|
||||
#define FP4816_2PI (2 * FP4816_PI)
|
||||
#define FP4816_05PI (FP4816_PI / 2)
|
||||
#define FP4816_15PI (FP4816_PI + FP4816_05PI)
|
||||
|
||||
#define FP_SQRT_2 fp4816_from_float_c(1.414213562373095)
|
||||
#define FP_INV_SQRT_2 fp4816_from_float_c(0.707106781)
|
||||
#define FP_SQRT_3 fp4816_from_float_c(1.73205080756887729352)
|
||||
#define FP_INV_SQRT_3 fp4816_from_float_c(0.577350269)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class FP4816
|
||||
{
|
||||
public:
|
||||
FP4816(int64_t value);
|
||||
FP4816(float value);
|
||||
private:
|
||||
int64_t value;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
union ieeefloat
|
||||
{
|
||||
float f;
|
||||
struct {
|
||||
uint32_t mantisse:23;
|
||||
uint32_t exponent:8;
|
||||
uint32_t sign:1;
|
||||
};
|
||||
};
|
||||
typedef union ieeefloat IEEEFLOAT;
|
||||
|
||||
#define IEEEFLOAT(p) ((IEEEFLOAT*)p)
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/errno.h>
|
||||
|
||||
typedef union {
|
||||
fp4816_t values[10];
|
||||
struct {
|
||||
fp4816_t kp,
|
||||
ki,
|
||||
kd;
|
||||
|
||||
fp4816_t integral,
|
||||
last_value,
|
||||
out;
|
||||
|
||||
fp4816_t lim_omin, // Lower Limit: Output
|
||||
lim_omax, // Upper Limit: Output
|
||||
lim_imin, // Lower Limit: Integral
|
||||
lim_imax; // Upper Limit: Integral
|
||||
};
|
||||
} fp4816_pid_t;
|
||||
|
||||
|
||||
fp4816_pid_t* pid4816_create (void);
|
||||
int pid4816_set (fp4816_pid_t *pid,fp4816_t Kp,fp4816_t Ki,fp4816_t Kd);
|
||||
|
||||
int pid4816_set_kp (fp4816_pid_t *pid,fp4816_t Kp);
|
||||
int pid4816_set_ki (fp4816_pid_t *pid,fp4816_t Ki);
|
||||
int pid4816_set_kd (fp4816_pid_t *pid,fp4816_t Kd);
|
||||
|
||||
int pid4816_get_kp (fp4816_pid_t *pid,fp4816_t *Kp);
|
||||
int pid4816_get_ki (fp4816_pid_t *pid,fp4816_t *Ki);
|
||||
int pid4816_get_kd (fp4816_pid_t *pid,fp4816_t *Kd);
|
||||
|
||||
int pid4816_set_limits
|
||||
(fp4816_pid_t *pid,fp4816_t *omin,fp4816_t *omax,fp4816_t *imin,fp4816_t *imax);
|
||||
int pid4816_get_limits
|
||||
(fp4816_pid_t *pid,fp4816_t *omin,fp4816_t *omax,fp4816_t *imin,fp4816_t *imax);
|
||||
|
||||
static inline int pid4816_clear (fp4816_pid_t *pid){
|
||||
if (!pid)
|
||||
return -ENULLPTR;
|
||||
|
||||
pid->integral = 0;
|
||||
pid->last_value = 0;
|
||||
pid->out = 0;
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
|
||||
int pid4816_cycle (fp4816_pid_t *pid,fp4816_t value);
|
||||
|
||||
static inline int pid4816_get_value(fp4816_pid_t *pid,fp4816_t *value){
|
||||
if (pid){
|
||||
*value = pid->out;
|
||||
return ESUCCESS;
|
||||
};
|
||||
return -ENULLPTR;
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <fixpoint/ieee.h>
|
||||
|
||||
struct Fixpoint
|
||||
{
|
||||
int64_t value;
|
||||
|
||||
Fixpoint();
|
||||
Fixpoint(int value);
|
||||
Fixpoint(int64_t value);
|
||||
Fixpoint(float value);
|
||||
|
||||
const Fixpoint operator+ (Fixpoint const& value);
|
||||
const Fixpoint operator- (Fixpoint const& value);
|
||||
const Fixpoint operator* (Fixpoint const& value);
|
||||
const Fixpoint operator/ (Fixpoint const& value);
|
||||
const Fixpoint operator% (Fixpoint const& value);
|
||||
|
||||
const Fixpoint& operator+= (Fixpoint const& value);
|
||||
const Fixpoint& operator-= (Fixpoint const& value);
|
||||
const Fixpoint& operator*= (Fixpoint const& value);
|
||||
const Fixpoint& operator/= (Fixpoint const& value);
|
||||
|
||||
};
|
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
class Signal
|
||||
{
|
||||
virtual void signal(int signal);
|
||||
};
|
||||
|
||||
class IRQ
|
||||
{
|
||||
public:
|
||||
IRQ();
|
||||
|
||||
|
||||
private:
|
||||
Signal signals[];
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <hw+/registers.h>
|
||||
|
||||
class Port
|
||||
{
|
||||
public:
|
||||
Port(uint16_t pin,uint16_t ddr,uint16_t port);
|
||||
|
||||
uint8_t DDR();
|
||||
void DDR(uint8_t value);
|
||||
|
||||
|
||||
|
||||
public:
|
||||
volatile BYTE *pin,
|
||||
*ddr,
|
||||
*port;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
union byte
|
||||
{
|
||||
uint8_t byte;
|
||||
struct
|
||||
{
|
||||
uint8_t bit0:1;
|
||||
uint8_t bit1:1;
|
||||
uint8_t bit2:1;
|
||||
uint8_t bit3:1;
|
||||
uint8_t bit4:1;
|
||||
uint8_t bit5:1;
|
||||
uint8_t bit6:1;
|
||||
uint8_t bit7:1;
|
||||
};
|
||||
} ;
|
||||
|
||||
typedef union byte BYTE;
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <hwo/bits.h>
|
||||
|
||||
struct _access
|
||||
{
|
||||
int32_t service_partner_id;
|
||||
int32_t staff_id;
|
||||
int32_t access_code;
|
||||
int32_t passcode;
|
||||
int32_t magic1;
|
||||
int32_t effective_rights;
|
||||
};
|
||||
|
||||
extern struct _access _access;
|
||||
|
||||
|
||||
int32_t access_authorize(struct _access* access);
|
||||
|
||||
static inline uint8_t access_check(struct _access* access,uint8_t n)
|
||||
{
|
||||
if (access->effective_rights & BIT(n))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define BIT(n) (1L<<n)
|
||||
|
||||
union bits32
|
||||
{
|
||||
int32_t i32;
|
||||
uint32_t ui32;
|
||||
float f32;
|
||||
int16_t i16[2];
|
||||
uint16_t ui16[2];
|
||||
int8_t i8[4];
|
||||
uint8_t ui8[4];
|
||||
};
|
||||
|
||||
union bits64
|
||||
{
|
||||
int64_t i64;
|
||||
int32_t i32[2];
|
||||
float f32[2];
|
||||
int16_t i16[4];
|
||||
int8_t i8[8];
|
||||
};
|
||||
|
||||
typedef union bits32 BITS32;
|
||||
typedef union bits64 BITS64;
|
||||
|
||||
typedef BITS32 bits32_t;
|
||||
typedef BITS64 bits64_t;
|
||||
|
||||
|
||||
static inline int32_t rol32(int32_t i,uint8_t n)
|
||||
{
|
||||
return (i << n) | (i >> (32 - n));
|
||||
};
|
||||
static inline int32_t ror32(int32_t i,uint8_t n)
|
||||
{
|
||||
return (i >> n) | (i << (32 - n));
|
||||
};
|
||||
|
||||
static inline int16_t rol16(int16_t i,uint8_t n)
|
||||
{
|
||||
return (i << n) | (i >> (16 - n));
|
||||
};
|
||||
static inline int16_t ror16(int16_t i,uint8_t n)
|
||||
{
|
||||
return (i >> n) | (i << (16 - n));
|
||||
};
|
||||
|
||||
static inline uint8_t rol8(uint8_t i,uint8_t n)
|
||||
{
|
||||
return (i << n) | (i >> (8 - n));
|
||||
};
|
||||
static inline uint8_t ror8(uint8_t i,uint8_t n)
|
||||
{
|
||||
return (i >> n) | (i << (8 - n));
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
union avr_chksum
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t sum8;
|
||||
uint8_t xor8;
|
||||
};
|
||||
uint16_t combined;
|
||||
};
|
||||
typedef union avr_chksum avrChksum;
|
||||
typedef union avr_chksum CHKSUM;
|
||||
|
||||
|
||||
|
||||
void chksum(CHKSUM* chksum,void* block,uint8_t len);
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void debug_serial(FILE* stream);
|
||||
FILE* debug_stream(void);
|
||||
void debug(char* line);
|
||||
|
||||
#define debugf(format,...) fprintf( debug_stream(), format "\r\n", ## __VA_ARGS__ )
|
||||
|
||||
void stack_chk(void);
|
|
@ -0,0 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <hwo/chksum.h>
|
||||
#include <sys/mutex.h>
|
||||
|
||||
struct avr_eeprom_desc
|
||||
{
|
||||
uint8_t num_banks;
|
||||
void* base_chksums;
|
||||
};
|
||||
|
||||
struct avr_eeprom
|
||||
{
|
||||
union {
|
||||
uint8_t data[32];
|
||||
uint16_t data16[16];
|
||||
uint32_t data32[8];
|
||||
float f32[8];
|
||||
int32_t i32[8];
|
||||
};
|
||||
};
|
||||
typedef struct avr_eeprom avrEEPROM;
|
||||
typedef struct avr_eeprom EEPROM;
|
||||
|
||||
extern MUTEX eepromMutex;
|
||||
|
||||
|
||||
uint16_t eeprom_load(uint8_t bank,avrEEPROM *data);
|
||||
uint16_t eeprom_save(uint8_t bank,avrEEPROM *data);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/events.h>
|
|
@ -0,0 +1,49 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <hwo/systick.h>
|
||||
|
||||
struct fifo
|
||||
{
|
||||
uint8_t size;
|
||||
uint8_t pWrite;
|
||||
uint8_t pRead;
|
||||
uint8_t *pBuffer;
|
||||
|
||||
union
|
||||
{
|
||||
struct {
|
||||
uint8_t blocking:1; // Blocking Mode
|
||||
uint8_t irq_rd:1, // fifo_read / fifo_poll called from IRQ (force non blocking)
|
||||
irq_wr:1; // fifo_write called from IRQ (force non blocking)
|
||||
};
|
||||
uint8_t flags;
|
||||
};
|
||||
|
||||
uint16_t timeout;
|
||||
avrWAIT wtimeout;
|
||||
};
|
||||
|
||||
typedef struct fifo FIFO;
|
||||
|
||||
// FIFO Options
|
||||
#define FO_BLOCKING (1<<0)
|
||||
#define FO_IRQ_RD (1<<1)
|
||||
#define FO_IRQ_WR (1<<2)
|
||||
|
||||
|
||||
FIFO* fifo_alloc (uint8_t size);
|
||||
|
||||
void fifo_write (FIFO* fifo,uint8_t byte);
|
||||
uint16_t fifo_read (FIFO* fifo);
|
||||
uint16_t fifo_poll (FIFO* fifo);
|
||||
|
||||
uint8_t fifo_avail (FIFO* fifo);
|
||||
uint8_t fifo_free (FIFO* fifo);
|
||||
|
||||
void fifo_set_blocking(FIFO* fifo,uint8_t blocking);
|
||||
void fifo_set_timeout(FIFO*fifo,uint16_t timeout);
|
||||
|
||||
void fifo_options(FIFO* fifo,uint8_t options);
|
||||
|
||||
uint16_t fifo_read_block (FIFO* fifo,uint8_t* buffer,int maxlen);
|
|
@ -0,0 +1,60 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define FP_FRAC 16
|
||||
#define FP_MASK (0xFFFFFFFF >> (32-FP_FRAC))
|
||||
|
||||
typedef int32_t fixpoint_t;
|
||||
|
||||
#define fp_float(a) (((double)a) / (1L<<FP_FRAC))
|
||||
#define fp_uint16(a) ((uint16_t)a>>FP_FRAC)
|
||||
#define fp_make(a) ((fixpoint_t)(a * (1L<<FP_FRAC)))
|
||||
|
||||
#define fp_add(a,b) (a + b)
|
||||
#define fp_sub(a,b) (a - b)
|
||||
|
||||
#define fp_mul(a,b) ((fixpoint_t)(((int64_t)a * (int64_t)b) >> FP_FRAC))
|
||||
#define fp_div(a,b) ((fixpoint_t)(((int64_t)a << FP_FRAC) / b))
|
||||
#define fp_get_fraction(a) (((fixpoint_t)a) & FP_MASK)
|
||||
#define fp_trunc_to_int32(a) (a / (1L<<FP_FRAC))
|
||||
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define FP_PI fp_make(M_PI)
|
||||
#define FP_2PI (2*FP_PI)
|
||||
|
||||
#define FP_SQRT_2 fp_make(1.414213562373095)
|
||||
#define FP_INV_SQRT_2 fp_make(0.707106781)
|
||||
#define FP_SQRT_3 fp_make(1.73205080756887729352)
|
||||
#define FP_INV_SQRT_3 fp_make(0.577350269)
|
||||
|
||||
|
||||
/* Trigonometrische Funktionen
|
||||
|
||||
[arc] = °
|
||||
|
||||
|
||||
Intervalle:
|
||||
|
||||
asin [-90 .. +90]
|
||||
acos [ 0 .. +180]
|
||||
|
||||
*/
|
||||
|
||||
fixpoint_t fp_sin(fixpoint_t arc);
|
||||
fixpoint_t fp_cos(fixpoint_t arc);
|
||||
fixpoint_t fp_tan(fixpoint_t arc);
|
||||
|
||||
fixpoint_t fp_asin(fixpoint_t sin);
|
||||
fixpoint_t fp_acos(fixpoint_t cos);
|
||||
fixpoint_t fp_atan(fixpoint_t tan);
|
||||
|
||||
fixpoint_t fp_normalize_arc(fixpoint_t arc);
|
||||
|
||||
uint8_t* fp_toa(fixpoint_t value,int pre,int dec);
|
||||
uint8_t* fp_toa_r(uint8_t* buffer,fixpoint_t value,int pre,int dec);
|
||||
|
||||
fixpoint_t fp_sin_lookup_reverse(fixpoint_t sin);
|
||||
fixpoint_t fp_sin_lookup(fixpoint_t arc090);
|
|
@ -0,0 +1,60 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <util/list.h>
|
||||
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/threads.h>
|
||||
|
||||
#define I2C_ERR_NACK -1
|
||||
|
||||
#define I2C_CBR(x) ((int)(0x80000000ul | x))
|
||||
|
||||
#define I2C_CBR_CONT I2C_CBR(0x01)
|
||||
#define I2C_CBR_NACK I2C_CBR(0x02)
|
||||
#define I2C_CBR_STOP I2C_CBR(0x04)
|
||||
|
||||
|
||||
/* int i2c_callback(int n,int ch)
|
||||
*
|
||||
* n Index des aktuellen Bytes (0 = 1.Byte, 1 = 2.byte,...)
|
||||
* ch Empfangenes Byte (oder -1 bei Sendebetrieb)
|
||||
* return: nächstes zu übertragene Byte, oder -1 für Ende der Übertragung
|
||||
*
|
||||
* Wird für jedes zu übertragende bzw. übertragenes Zeichen gerufen.
|
||||
*
|
||||
*/
|
||||
typedef int(*i2c_callback)(void* p,int n,int ch);
|
||||
|
||||
struct i2c
|
||||
{
|
||||
MUTEX mutex;
|
||||
|
||||
int clock;
|
||||
|
||||
volatile struct {
|
||||
uint8_t slave;
|
||||
uint8_t ptr; // Lese/Schreib Index für aktiven Request
|
||||
|
||||
int error;
|
||||
|
||||
i2c_callback
|
||||
callback;
|
||||
void *p;
|
||||
|
||||
THREAD *owner;
|
||||
|
||||
uint8_t length;
|
||||
uint8_t *buffer;
|
||||
};
|
||||
};
|
||||
extern struct i2c i2c;
|
||||
|
||||
void i2c_init(uint32_t clk);
|
||||
int i2c_transfer(uint8_t slave,uint8_t *buffer,uint8_t length);
|
||||
int i2c_transfer_ex(uint8_t slave,i2c_callback callback,void *p);
|
||||
|
||||
void i2c_lock(void);
|
||||
void i2c_release(void);
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
#pragma once
|
||||
|
||||
/*******************************************************************************************************
|
||||
|
||||
konsole.h Definitionen un Deklarationen der integrierten seriellen Konsole für ANSI/vt100
|
||||
|
||||
*******************************************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <hwo/systick.h>
|
||||
#include <util/list.h>
|
||||
|
||||
#define KON_TYPE_EMPTY 0x00
|
||||
#define KON_TYPE_INT8 0x01
|
||||
#define KON_TYPE_INT16 0x02
|
||||
#define KON_TYPE_INT32 0x03
|
||||
#define KON_TYPE_INT64 0x04
|
||||
#define KON_TYPE_FLOAT 0x05
|
||||
#define KON_TYPE_PTR 0x06
|
||||
#define KON_TYPE_STRING 0x07
|
||||
|
||||
#define KON_TYPE_REF 0x20 // Referenzierung durch <ptr>
|
||||
#define KON_TYPE_HEX 0x40 // Darstellung in 0x...
|
||||
#define KON_TYPE_SPEC 0x80 // Spezielles Feld
|
||||
|
||||
#define KON_SPEC_TICKS 0x80
|
||||
#define KON_SPEC_BRKVAL 0x81
|
||||
#define KON_SPEC_SPLIM 0x82
|
||||
|
||||
struct avr_konsole;
|
||||
struct avr_konsole_field;
|
||||
struct avr_konsole_command;
|
||||
struct avr_konsole_commandline;
|
||||
struct avr_konsole_command_define;
|
||||
|
||||
typedef struct avr_konsole KONSOLE;
|
||||
typedef struct avr_konsole_commandline KON_CMDLINE;
|
||||
|
||||
typedef struct avr_konsole_command_define
|
||||
KON_CMD_DEFINE;
|
||||
#define KON_CMD_DEFINE(ptr) ((KON_CMD_DEFINE*)ptr)
|
||||
|
||||
|
||||
typedef struct avr_konsole_field avrKonsoleField;
|
||||
typedef struct avr_konsole_command avrKonsoleCommand;
|
||||
|
||||
//typedef uint8_t (*cbKonsoleCommand)(avrKonsole* konsole,avrKonsoleCommand *command); // Callback für benutzerdefinierte Befehle
|
||||
typedef uint8_t (*cbKonsoleUpdateField)(avrKonsoleField *field);
|
||||
|
||||
typedef uint8_t (*cbKonsoleCommandEx)(KONSOLE* konsole,KON_CMD_DEFINE *cmddef,KON_CMDLINE *cmdline);
|
||||
|
||||
|
||||
struct avr_konsole_field
|
||||
{
|
||||
char *label;
|
||||
uint8_t type;
|
||||
uint8_t code; // USER Byte for identification
|
||||
uint8_t width;
|
||||
union
|
||||
{
|
||||
void *ptr;
|
||||
char *pString;
|
||||
int8_t i8;
|
||||
int16_t i16;
|
||||
int32_t i32;
|
||||
int64_t i64;
|
||||
float f;
|
||||
};
|
||||
};
|
||||
|
||||
struct avr_konsole_commandline
|
||||
{
|
||||
char *first,
|
||||
*second,
|
||||
*third,
|
||||
*fourth;
|
||||
|
||||
char *last;
|
||||
};
|
||||
|
||||
struct avr_konsole_command_define
|
||||
{
|
||||
list_t list;
|
||||
|
||||
char cmdWord[12];
|
||||
|
||||
list_t subcmds;
|
||||
|
||||
cbKonsoleCommandEx
|
||||
cbCommand;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct avr_konsole
|
||||
{
|
||||
FILE *stream; // FILE struktur für <serial>
|
||||
FILE *pipe;
|
||||
|
||||
avrWAIT wait_status; // Timer für Neuzeichnen der Statusfelder
|
||||
|
||||
char cmdline[128]; // Buffer für Eingabezeile
|
||||
uint8_t pCmdline; // Zeiger auf nächstes freies zeichen in <cmdline>
|
||||
|
||||
char *greeting; // Begrüßung nach Konsolenstart
|
||||
|
||||
KON_CMD_DEFINE
|
||||
commandroot;
|
||||
|
||||
cbKonsoleUpdateField cbUpdate;
|
||||
avrKonsoleField *statusfields[4]; // Zeiger auf Statusfelder für die ersten 6 Zeilen
|
||||
};
|
||||
|
||||
KONSOLE* konsole_create (FILE *stream);
|
||||
uint8_t konsole_set_command (KONSOLE *konsole, char *command, cbKonsoleCommandEx cbCommandEx);
|
||||
|
||||
uint8_t konsole_start(KONSOLE *konsole);
|
||||
uint8_t konsole_cmdline(KONSOLE *konsole);
|
||||
|
||||
uint8_t konsole_read_line (FILE *stream, char *buffer, uint8_t maxsize);
|
||||
|
||||
void dbg_print_threads(FILE *stream);
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <hwo/eeprom.h>
|
||||
|
||||
|
||||
union u_log_csr
|
||||
{
|
||||
avrEEPROM eeprom;
|
||||
struct
|
||||
{
|
||||
uint8_t wp;
|
||||
uint8_t res[15];
|
||||
uint8_t mcucsr[16];
|
||||
};
|
||||
};
|
||||
typedef union u_log_csr LogCSR;
|
||||
|
||||
void log_csr(void);
|
||||
uint8_t get_csr(void);
|
||||
LogCSR* get_csr_log(void);
|
|
@ -0,0 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#warning hwo/mutex.h is deprecated. Use sys/mutex.h
|
||||
|
||||
#include <sys/mutex.h>
|
|
@ -0,0 +1,71 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <fixpoint/fp248.h>
|
||||
#include <fixpoint/fp4816.h>
|
||||
|
||||
#define KI_FROM_TN(tn) (1/tn)
|
||||
#define TN_FROM_KI(ki) (1/ki)
|
||||
|
||||
struct _pi_float
|
||||
{
|
||||
float limit_min,
|
||||
limit_max;
|
||||
float kp,
|
||||
ki;
|
||||
float integral;
|
||||
};
|
||||
typedef struct _pi_float PI_FLOAT;
|
||||
|
||||
static inline float pi_float_cycle(PI_FLOAT *pi,float value)
|
||||
{
|
||||
pi->integral += pi->ki * value;
|
||||
if (pi->integral > pi->limit_max)
|
||||
pi->integral = pi->limit_max;
|
||||
if (pi->integral < pi->limit_min)
|
||||
pi->integral = pi->limit_min;
|
||||
return pi->integral + (pi->kp * value);
|
||||
};
|
||||
|
||||
struct _pi_fp248
|
||||
{
|
||||
fp248_t limit_min,
|
||||
limit_max;
|
||||
fp248_t kp,
|
||||
ki;
|
||||
fp248_t integral;
|
||||
};
|
||||
typedef struct _pi_fp248 PI_FP248;
|
||||
|
||||
static inline fp248_t pi_fp248_cycle(PI_FP248 *pi,fp248_t value)
|
||||
{
|
||||
pi->integral += fp248_mul(pi->ki, value);
|
||||
if (pi->integral > pi->limit_max)
|
||||
pi->integral = pi->limit_max;
|
||||
if (pi->integral < pi->limit_min)
|
||||
pi->integral = pi->limit_min;
|
||||
return pi->integral + fp248_mul(pi->kp, value);
|
||||
};
|
||||
|
||||
|
||||
struct _pi_fp4816
|
||||
{
|
||||
fp4816_t limit_min,
|
||||
limit_max;
|
||||
fp4816_t kp,
|
||||
ki;
|
||||
fp4816_t integral;
|
||||
};
|
||||
typedef struct _pi_fp4816 PI_FP4816;
|
||||
|
||||
static inline fp4816_t pi_fp4816_cycle(PI_FP4816 *pi,fp4816_t value)
|
||||
{
|
||||
pi->integral += fp4816_mul(pi->ki, value);
|
||||
if (pi->integral > pi->limit_max)
|
||||
pi->integral = pi->limit_max;
|
||||
if (pi->integral < pi->limit_min)
|
||||
pi->integral = pi->limit_min;
|
||||
return pi->integral + fp4816_mul(pi->kp, value);
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <hwo/stdio.h>
|
||||
|
||||
FILE* dev_null(void);
|
|
@ -0,0 +1,65 @@
|
|||
#pragma once
|
||||
|
||||
#include <hwo/chksum.h>
|
||||
|
||||
/*****
|
||||
|
||||
platform.h Platform Definition für AVR8 / Bootloader / Externe EEPROMS
|
||||
|
||||
*****/
|
||||
|
||||
#define ENTITY_NULL 0x0000 // Kein Inhalt, Füller
|
||||
#define ENTITY_FIRMWARE 0x0001 // Firmware Image
|
||||
|
||||
#define ENTITY_USER 0x8000 // Erster Type für Anwendungstypen
|
||||
|
||||
struct platform_entity
|
||||
{
|
||||
uint16_t type;
|
||||
uint32_t size;
|
||||
|
||||
avrChksum chksum;
|
||||
};
|
||||
|
||||
struct platform_eeprom_header
|
||||
{
|
||||
uint8_t magic[4]; // Magic bytes [ 0x43, 0x52, 0x65, 0xD2 ]
|
||||
|
||||
struct
|
||||
{
|
||||
uint8_t version_low;
|
||||
uint8_t version_high;
|
||||
|
||||
uint8_t board_id_low;
|
||||
uint8_t board_id_high;
|
||||
|
||||
uint16_t board_revision;
|
||||
} bootloader;
|
||||
|
||||
struct
|
||||
{
|
||||
uint8_t version_low;
|
||||
uint8_t version_high;
|
||||
|
||||
uint16_t build;
|
||||
uint16_t size;
|
||||
|
||||
avrChksum chksum;
|
||||
} firmware;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32_t update_req:1; // Request Bootloader for Firmware Update
|
||||
uint32_t update_ack:1; // Bootloader has Updated Firmware successfull
|
||||
uint32_t update_err_chksum:1; // Bootloader denied update due to chksum error
|
||||
uint32_t update_err_license:1; // Bootloader denied update due to license error
|
||||
|
||||
uint32_t reserve:28;
|
||||
|
||||
} flags;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
#include <sys/runtime.h>
|
|
@ -0,0 +1,75 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <hwo/fifo.h>
|
||||
|
||||
#define SERIAL_5BIT 0x0100
|
||||
#define SERIAL_6BIT 0x0200
|
||||
#define SERIAL_7BIT 0x0400
|
||||
#define SERIAL_8BIT 0x0800
|
||||
|
||||
#define SERIAL_PAR_E 0x1000
|
||||
#define SERIAL_PAR_O 0x2000
|
||||
|
||||
#define SERIAL_STOP2 0x4000
|
||||
|
||||
struct avr_serial;
|
||||
typedef struct avr_serial avrSerial;
|
||||
|
||||
typedef void (*serial_cb_rx)(void *arg,uint8_t ch);
|
||||
|
||||
/**
|
||||
* @class avr_serial
|
||||
* @author Harald Wolff
|
||||
* @date
|
||||
* @file serial.h
|
||||
* @brief Structure for serial device
|
||||
*/
|
||||
struct avr_serial
|
||||
{
|
||||
avrSerial* next;
|
||||
|
||||
uint8_t (*init)(avrSerial* serial,uint32_t baudrate,uint32_t config); // Setup Port
|
||||
void (*notify)(avrSerial* serial); // Notify of new byte to send in fifo_tx
|
||||
void (*flush)(avrSerial *serial); // Warten bis alle Zeichen gesendet wurden
|
||||
/*
|
||||
void (*tx)(avrSerial* serial,uint8_t byte);
|
||||
uint16_t (*rx)(avrSerial* serial);
|
||||
*/
|
||||
FIFO* fifo_tx;
|
||||
FIFO* fifo_rx;
|
||||
|
||||
void* driver;
|
||||
};
|
||||
|
||||
extern avrSerial* _serial_head;
|
||||
|
||||
void serial_register(avrSerial* serial);
|
||||
void usart_register(void);
|
||||
|
||||
uint8_t serial_init(avrSerial* serial,uint32_t baudrate,uint32_t config);
|
||||
|
||||
void serial_tx_byte(avrSerial* serial,uint8_t byte);
|
||||
void serial_tx_string(avrSerial* serial,char* string);
|
||||
void serial_tx(avrSerial* serial,uint8_t* data,uint8_t len);
|
||||
|
||||
void serial_flush(avrSerial *serial);
|
||||
|
||||
uint16_t serial_rx_byte(avrSerial* serial);
|
||||
uint16_t serial_rx_line(avrSerial* serial,char* buffer,uint8_t maxlen);
|
||||
uint16_t serial_rx(avrSerial* serial,uint8_t* buffer,uint8_t len);
|
||||
|
||||
uint16_t serial_poll_byte(avrSerial* serial);
|
||||
|
||||
uint16_t serial_rxready(avrSerial* serial);
|
||||
|
||||
avrSerial* serial_get(uint8_t no);
|
||||
avrSerial* serial_null(void);
|
||||
|
||||
FILE* serial_build_stream(avrSerial* serial);
|
||||
|
||||
void serial_set_blocking(avrSerial *serial,uint8_t blocking);
|
||||
void serial_set_timeout(avrSerial *serial,uint16_t timeout);
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// stack flags
|
||||
#define ST_SYSTEM 0x0001 // System Stack Segment
|
||||
#define ST_FREE 0x0002 // Stack Segment is not in use, may be reallocated to new thread
|
||||
|
||||
#define STACK_TOP(stack) (&stack->base[stack->size - 1])
|
||||
|
||||
struct stStack
|
||||
{
|
||||
uint8_t *base;
|
||||
uint16_t size;
|
||||
|
||||
uint16_t flags;
|
||||
|
||||
struct stStack *next;
|
||||
};
|
||||
typedef struct stStack avrStack;
|
||||
|
||||
|
||||
uint16_t stack_system_resize(uint16_t size);
|
||||
avrStack* stack_alloc(uint16_t size);
|
||||
void stack_free(avrStack *stack);
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
extern char __PRO_STAMP;
|
||||
|
||||
#define STAMP ((uint16_t)&__PRO_STAMP)
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
#pragma once
|
||||
|
||||
/**************************************************************************************
|
||||
statemachine.h
|
||||
|
||||
Universelle Funktionen zum errichten einer Statemachine
|
||||
|
||||
**************************************************************************************/
|
||||
|
||||
#include <hwo/mutex.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint8_t (*StateMachineChangerCallback)(uint8_t oldstate,uint8_t newstate);
|
||||
|
||||
struct _sm_statemachine
|
||||
{
|
||||
StateMachineChangerCallback *callbacks;
|
||||
uint8_t numcallbacks;
|
||||
|
||||
uint8_t state,
|
||||
changing_to,
|
||||
change_to;
|
||||
|
||||
MUTEX mutex;
|
||||
};
|
||||
|
||||
void sm_set_changerlist(StateMachineChangerCallback *callbacklist);
|
||||
uint8_t sm_state(void);
|
||||
void sm_change(uint8_t tostate);
|
||||
void sm_change_immediate(uint8_t newstate);
|
||||
|
||||
void sm_wait(uint8_t state);
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/sysevents.h>
|
|
@ -0,0 +1,55 @@
|
|||
#pragma once
|
||||
|
||||
/************************************************************
|
||||
|
||||
hwo/systick.h
|
||||
|
||||
define systick methods for generating periodic events
|
||||
used by...
|
||||
-multithreading environment
|
||||
-user defined event
|
||||
|
||||
uses timer0 for generating ticks
|
||||
|
||||
************************************************************/
|
||||
|
||||
#include <sys/systick.h>
|
||||
|
||||
#if 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cpu/systick.h>
|
||||
|
||||
typedef uint32_t systick_t;
|
||||
|
||||
struct avr_wait
|
||||
{
|
||||
systick_t target;
|
||||
};
|
||||
typedef struct avr_wait avrWAIT;
|
||||
|
||||
typedef void (*systick_handler)(systick_t ticks);
|
||||
|
||||
extern volatile uint32_t _systick_secs; // system uptime in [s]
|
||||
extern volatile systick_t _systick_ticks; // system uptime in [us]
|
||||
|
||||
void systick_init(systick_t systick_us);
|
||||
void systick(void);
|
||||
void systick_set_us(systick_t tickus);
|
||||
|
||||
systick_t systick_ticks(void);
|
||||
uint32_t systick_secs(void);
|
||||
|
||||
void systick_set_handler(systick_handler handler);
|
||||
void systick_set_handler_sec(systick_handler handler);
|
||||
|
||||
void wait_ms(systick_t ms);
|
||||
|
||||
void wait_async_set(avrWAIT* wait,systick_t us);
|
||||
uint8_t wait_async_test(avrWAIT* wait);
|
||||
|
||||
*
|
||||
/* Interface to CPU Low Level Routines */
|
||||
void systick_timer_init(uint32_t systick_us);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,51 @@
|
|||
#pragma once
|
||||
|
||||
/***********************************************************************
|
||||
|
||||
terminal.h
|
||||
|
||||
ANSI Terminal Code Interface for avr8os
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define TERM_ESC "\x1b"
|
||||
#define TERM_CSI TERM_ESC "["
|
||||
#define TERM_HOME TERM_CSI "H"
|
||||
#define TERM_CLEAR TERM_CSI "2J"
|
||||
#define TERM_SAVE_POS TERM_CSI "s"
|
||||
#define TERM_REST_POS TERM_CSI "u"
|
||||
#define TERM_HIDE TERM_CSI "?25l"
|
||||
#define TERM_SHOW TERM_CSI "?25h"
|
||||
#define TERM_CLEAR_LINE TERM_CSI "2K"
|
||||
#define TERM_CLEAR_EOL TERM_CSI "K"
|
||||
#define TERM_ENA_SCROLL TERM_CSI "r"
|
||||
|
||||
#define TERM_SAVE_CURSOR TERM_ESC "7"
|
||||
#define TERM_REST_CURSOR TERM_ESC "8"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define term_clear(s) fprintf(s,TERM_CLEAR)
|
||||
#define term_home(s) fprintf(s,TERM_HOME)
|
||||
#define term_save(s) fprintf(s,TERM_SAVE_POS)
|
||||
#define term_restore(s) fprintf(s,TERM_REST_POS)
|
||||
#define term_hide(s) fprintf(s,TERM_HIDE)
|
||||
#define term_show(s) fprintf(s,TERM_SHOW)
|
||||
#define term_clear_line(s) fprintf(s,TERM_CLEAR_LINE)
|
||||
#define term_clear_eol(s) fprintf(s,TERM_CLEAR_EOL)
|
||||
#define term_ena_scroll(s) fprintf(s,TERM_ENA_SCROLL)
|
||||
#define term_scroll(s,start,end) term_p2(s,'r',start,end)
|
||||
#define term_goto(s,x,y) term_p2(s,'H',y,x)
|
||||
|
||||
#define term_save_cursor(s) fprintf(s,TERM_SAVE_CURSOR)
|
||||
#define term_restore_cursor(s) fprintf(s,TERM_REST_CURSOR)
|
||||
|
||||
|
||||
void term_p2(FILE* stream,uint8_t cmd,uint8_t a,uint8_t b);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/threads.h>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/trace.h>
|
|
@ -0,0 +1,72 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/threads.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define LOW(a) (a&0xFF)
|
||||
#define HIGH(a) ((a>>8)&0xff)
|
||||
|
||||
#define zeromem(a) memset(&a,0x00,sizeof(a));
|
||||
#define RETFAIL(a) if (a) return -1;
|
||||
|
||||
#define FAIL(a) { int8_t r = (a); if (r) { return r; }; }
|
||||
#define FAILDBG(a) { int8_t r = (a); if (r) { lasterror = (r&0xffff) | (((uint32_t)getPC())<<16); return r; }; }
|
||||
|
||||
#define IFAIL(a) { int8_t r = (a); if (!r) { return -127; }; }
|
||||
#define IFAILDBG(a) { int8_t r = (a); if (!r) { lasterror = (((uint32_t)getPC())<<16); return -127; }; }
|
||||
|
||||
extern uint32_t __freq_cpu;
|
||||
extern uint8_t* __brkval;
|
||||
extern uint8_t* __stack_limit;
|
||||
extern thread_t* _thread_current;
|
||||
|
||||
extern uint16_t dbgPtr;
|
||||
extern uint32_t lasterror;
|
||||
|
||||
#define MALLOC_CLEANUP(type,var,size) \
|
||||
inline void __freefree(type **pptr) { free((void*)*pptr); }; \
|
||||
type* var __attribute__((__cleanup__(__freefree))) = (type*)malloc(size);
|
||||
|
||||
#define WAITFOR( var ) { while (!var) yield(); }
|
||||
|
||||
struct _smoother
|
||||
{
|
||||
float sum,
|
||||
inv_n;
|
||||
};
|
||||
typedef struct _smoother SMOOTHER;
|
||||
|
||||
|
||||
float smooth(SMOOTHER *s,float input);
|
||||
void smoother_set(SMOOTHER *s,float sum,float n);
|
||||
|
||||
#define DBG_SAVE_MEMLIMITS() eeprom_write_word( (void*)0x00, (int16_t)__brkval ); \
|
||||
eeprom_write_word( (void*)0x02, (int16_t) __stack_limit ); \
|
||||
eeprom_write_word( (void*)0x04, SP ); \
|
||||
eeprom_write_word( (void*)0x06, (int16_t)_thread_current->stack->base );
|
||||
|
||||
int wcslen(wchar_t* str);
|
||||
|
||||
int64_t ifact(int n);
|
||||
|
||||
static inline void i32_xch(void *ptr)
|
||||
{
|
||||
uint8_t *b = ptr;
|
||||
uint8_t a;
|
||||
|
||||
a = b[0];
|
||||
b[0] = b[3];
|
||||
b[3] = a;
|
||||
a = b[1];
|
||||
b[1] = b[2];
|
||||
b[2] = a;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/threads.h>
|
||||
|
||||
struct __pipe
|
||||
{
|
||||
volatile uint8_t *buffer;
|
||||
volatile int size;
|
||||
volatile int
|
||||
read,
|
||||
write;
|
||||
|
||||
uint8_t options;
|
||||
|
||||
THREAD *wait_get,
|
||||
*wait_put;
|
||||
};
|
||||
typedef struct __pipe PIPE;
|
||||
#define PIPE(ptr) ((PIPE*)ptr)
|
||||
|
||||
typedef struct {
|
||||
FILE file;
|
||||
PIPE pipe;
|
||||
} fdPIPE;
|
||||
#define fdPIPE(ptr) ((fdPIPE*)(ptr))
|
||||
|
||||
int pipe_clear(FILE* pipe);
|
||||
int pipe_options(FILE* pipe,uint8_t options);
|
||||
|
||||
int pipe_get(FILE* stream);
|
||||
int pipe_put(char c,FILE* stream);
|
||||
|
||||
static inline int pipe_full(FILE* pipe)
|
||||
{
|
||||
return (
|
||||
((fdPIPE(pipe)->pipe.read == 0) && (fdPIPE(pipe)->pipe.write == fdPIPE(pipe)->pipe.size - 1)) ||
|
||||
(fdPIPE(pipe)->pipe.write + 1 == fdPIPE(pipe)->pipe.read)
|
||||
);
|
||||
};
|
||||
|
||||
static inline int pipe_empty(FILE* pipe)
|
||||
{
|
||||
return (fdPIPE(pipe)->pipe.read == fdPIPE(pipe)->pipe.write);
|
||||
};
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
#pragma once
|
||||
|
||||
#include <util/util.h>
|
||||
|
||||
#if defined(__USART_BUFFER__) // buffer based i/o
|
||||
#else
|
||||
#include <util/fifo.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define USART_5BIT 0x0100
|
||||
#define USART_6BIT 0x0200
|
||||
#define USART_7BIT 0x0400
|
||||
#define USART_8BIT 0x0800
|
||||
|
||||
#define USART_PAR_E 0x1000
|
||||
#define USART_PAR_O 0x2000
|
||||
|
||||
#define USART_STOP2 0x4000
|
||||
|
||||
#define USART_MODE_TX (1<<0)
|
||||
#define USART_MODE_RX (1<<1)
|
||||
|
||||
|
||||
typedef struct __io_usart usart_t;
|
||||
|
||||
|
||||
struct __io_usart
|
||||
{
|
||||
int (*configure) (usart_t *usart,uint32_t baud,uint32_t config);
|
||||
int (*mode_set) (usart_t *usart,uint16_t mode);
|
||||
int (*mode_clear) (usart_t *usart,uint16_t mode);
|
||||
|
||||
#if defined(__USART_BUFFER__) // buffer based i/o
|
||||
|
||||
buffer_t tx,
|
||||
rx;
|
||||
|
||||
#else // fifo based i/o
|
||||
|
||||
#define usart_fifo_t fifo64_t
|
||||
#define usart_fifo_read f64_read
|
||||
#define usart_fifo_write f64_write
|
||||
|
||||
usart_fifo_t
|
||||
tx,
|
||||
rx;
|
||||
|
||||
#endif
|
||||
|
||||
uint8_t driverdata[0];
|
||||
};
|
||||
|
||||
usart_t* usart_device_get(int usart);
|
||||
|
||||
int usart_configure (uint8_t usart,uint32_t baud,uint32_t config);
|
||||
int usart_options (uint8_t usart,uint8_t options);
|
||||
|
||||
#define usart_tx_str(u,t) usart_tx(u,t,strlen(t))
|
||||
|
||||
#if defined(__USART_BUFFER__)
|
||||
|
||||
int usart_tx (uint8_t usart,void *data,int size);
|
||||
int usart_tx_done (uint8_t usart);
|
||||
|
||||
int usart_rx (uint8_t usart,void *data,int size);
|
||||
int usart_rx_done (uint8_t usart);
|
||||
|
||||
|
||||
#else
|
||||
|
||||
int usart_read (uint8_t usart);
|
||||
int usart_write (uint8_t usart,int ch);
|
||||
|
||||
int usart_tx (uint8_t usart,char *b,int size);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,160 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <hwo/serial.h>
|
||||
#include <hwo/chksum.h>
|
||||
#include <hwo/threads.h>
|
||||
#include <hwo/systick.h>
|
||||
|
||||
#include <sys/errno.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <util/list.h>
|
||||
|
||||
#include <io/usart.h>
|
||||
|
||||
/***********************************
|
||||
rb2/regbus.h
|
||||
|
||||
RegisteredBus2
|
||||
|
||||
Paketorientierte Kommunikation via Serielle Verbindungen mit Adressierung
|
||||
|
||||
***********************************/
|
||||
|
||||
extern RB2_INSTANCE __rb2_instance;
|
||||
|
||||
int rb2_request (RB2_ADDR receiver,uint16_t registerno,uint8_t type,void *data);
|
||||
|
||||
static inline int rb2_read_int32(RB2_ADDR receiver,uint16_t registerno,int32_t *i32) {
|
||||
return rb2_request(receiver,registerno,RDT_INT32,i32);
|
||||
};
|
||||
static inline int rb2_read_float(RB2_ADDR receiver,uint16_t registerno,float *f32) {
|
||||
return rb2_request(receiver,registerno,RDT_FLOAT,f32);
|
||||
};
|
||||
|
||||
static inline int rb2_write_int32(RB2_ADDR receiver,uint16_t registerno,int32_t *i32) {
|
||||
return rb2_request(receiver,registerno,RDT_INT32 | RDT_WRITE,i32);
|
||||
};
|
||||
static inline int rb2_write_float(RB2_ADDR receiver,uint16_t registerno,float *f32) {
|
||||
return rb2_request(receiver,registerno,RDT_FLOAT | RDT_WRITE,f32);
|
||||
};
|
||||
|
||||
static inline int rb2_write_int32_d(RB2_ADDR receiver,uint16_t registerno,int32_t i32) {
|
||||
return rb2_request(receiver,registerno,RDT_INT32 | RDT_WRITE,&i32);
|
||||
};
|
||||
static inline int rb2_write_float_d(RB2_ADDR receiver,uint16_t registerno,float f32) {
|
||||
return rb2_request(receiver,registerno,RDT_FLOAT | RDT_WRITE,&f32);
|
||||
};
|
||||
|
||||
//static inline RB2_INSTANCE* rb2_instance(void) { return &__rb2_instance; };
|
||||
#define rb2_instance() (&__rb2_instance)
|
||||
|
||||
static inline uint8_t rb2_first_id(void) { return (__rb2_instance.proxy.next) ? RB2_PROXY(__rb2_instance.proxy.next)->id : 0 ; };
|
||||
|
||||
static inline uint8_t rb2_request_is_local(RB2_TELEGRAM *telegram) {
|
||||
if ( ((telegram->receiver.ax == __rb2_instance.ax)||(telegram->receiver.ax==0)) && (__rb2_instance.idmask & (1<<telegram->receiver.node)) ){
|
||||
return -1;
|
||||
};
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
static inline void rb2_proxy_init(RB2_PROXY *proxy) {
|
||||
memset( proxy, 0x00, sizeof(RB2_PROXY) );
|
||||
list_init( &proxy->segments );
|
||||
};
|
||||
|
||||
static inline void rb2_add_proxy(RB2_PROXY *proxy) {
|
||||
list_append( &(proxy->list), &((&__rb2_instance)->proxy) );
|
||||
__rb2_instance.idmask |= (1 << proxy->id);
|
||||
};
|
||||
|
||||
static inline void rb2_remove_proxy(RB2_PROXY *proxy) {
|
||||
list_remove( &(proxy->list) );
|
||||
__rb2_instance.idmask &= ~(1 << proxy->id);
|
||||
};
|
||||
|
||||
static inline void rb2_add_rsegment(RB2_PROXY *proxy,RB2_RSEGMENT *segment) {
|
||||
list_append( &segment->list, &proxy->segments );
|
||||
};
|
||||
|
||||
static inline RB2_PROXY* rb2_get_proxy(uint8_t id) {
|
||||
list_t* i;
|
||||
|
||||
for_each_list_entry(i,&((&__rb2_instance)->proxy)){
|
||||
RB2_PROXY *p = list_entry(i,RB2_PROXY,list);
|
||||
if (p->id == id){
|
||||
return p;
|
||||
}
|
||||
};
|
||||
return NULL;
|
||||
};
|
||||
|
||||
|
||||
uint8_t rb2_init (uint8_t ax);
|
||||
void rb2_loop (void* arg); // Management Thread
|
||||
void rb2_loop_rx ();
|
||||
void rb2_loop_tx ();
|
||||
void rb2_loop_ident ();
|
||||
|
||||
void rb2_handle_request(rb2_telegram_buffer_t *telegram);
|
||||
void rb2_handle_response(rb2_telegram_buffer_t *telegram);
|
||||
|
||||
void rb2_route (RB2_TELEGRAM *request);
|
||||
void rb2_route_listed(rb2_telegram_buffer_t *txtele);
|
||||
void rb2_router (void *arg);
|
||||
|
||||
int rb2_build_request (RB2_REQUEST *request,RB2_ADDR receiver,uint16_t registerno,uint8_t type,void *data);
|
||||
int rb2_enqueue_pending (RB2_REQUEST *request);
|
||||
int rb2_unqueue_pending (RB2_REQUEST *request);
|
||||
|
||||
RB2_LINK* rb2_create_stream_link(FILE *stream);
|
||||
RB2_LINK* rb2_create_usart_link(uint8_t _usart);
|
||||
|
||||
uint16_t
|
||||
rb2_known_endpoints(void);
|
||||
|
||||
|
||||
void rb2_api_rx (rb2_telegram_buffer_t *telegram);
|
||||
void rb2_convert (uint8_t srctype,void *src,uint8_t dsttype, void *dst);
|
||||
|
||||
uint8_t rb2_default_register_proc(RB2_REGISTER *reg,RB2_TELEGRAM *telegram);
|
||||
|
||||
|
||||
static inline int rb2_link_add (RB2_LINK *link){
|
||||
cpustate_t state;
|
||||
|
||||
spinlock_lock_irq( &__rb2_instance.links.lock, &state );
|
||||
list_append( &(link->list), &(__rb2_instance.links.list) );
|
||||
spinlock_release_irq( &__rb2_instance.links.lock, &state );
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
rb2_telegram_buffer_t* rb2_pool_pop (void);
|
||||
rb2_telegram_buffer_t* rb2_pool_pop_irq(void);
|
||||
void rb2_pool_push (rb2_telegram_buffer_t *tele);
|
||||
|
||||
|
||||
/* DEBUG / Tracing */
|
||||
|
||||
void _dbg_trace_rb2_usart_tx(rb2_telegram_buffer_t *telegram) __attribute__(( weak ));
|
||||
void _dbg_trace_rb2_usart_rx(rb2_telegram_buffer_t *telegram) __attribute__(( weak ));
|
||||
|
||||
void _dbg_trace_rb2_can_tx(rb2_telegram_buffer_t *telegram) __attribute__(( weak ));
|
||||
void _dbg_trace_rb2_can_rx(rb2_telegram_buffer_t *telegram) __attribute__(( weak ));
|
||||
|
||||
extern int32_t _dbg_rb2_usart_sync,
|
||||
_dbg_rb2_usart_sync_min,
|
||||
_dbg_rb2_usart_sync_max;
|
||||
extern int32_t _dbg_rb2_usart_txtele,
|
||||
_dbg_rb2_usart_rxtele;
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <util/list.h>
|
||||
#include <sys/spinlock.h>
|
||||
|
||||
/***********************************
|
||||
rb2/instance.h
|
||||
|
||||
RegisteredBus2
|
||||
|
||||
Paketorientierte Kommunikation via Serielle Verbindungen mit Adressierung
|
||||
|
||||
***********************************/
|
||||
|
||||
|
||||
|
||||
struct _rb2_instance
|
||||
{
|
||||
uint8_t ax; // Achsnummer dieses Endpunktes
|
||||
|
||||
uint16_t idmask; // 0x02 Maske aller eigenen IDs
|
||||
|
||||
uint8_t enabled:1; // 0x04 Endpunkt ist aktiv
|
||||
uint8_t ringmaster:1; // Dieser Knoten ist der Master des RING-BUS
|
||||
uint8_t reserve:6;
|
||||
|
||||
uint8_t axes; // Anzahl angeschlossener Achsen
|
||||
|
||||
struct {
|
||||
spinlock_t lock;
|
||||
|
||||
list_t list; //
|
||||
RB2_LINK *ringlink;
|
||||
} links;
|
||||
|
||||
avrWAIT ident_timeout;
|
||||
uint32_t timeout;
|
||||
|
||||
struct {
|
||||
spinlock_t sl_router;
|
||||
spinlock_t sl_pending;
|
||||
|
||||
volatile list_t router;
|
||||
volatile list_t pending;
|
||||
} queues;
|
||||
|
||||
|
||||
list_t proxy;
|
||||
|
||||
struct {
|
||||
THREAD *router;
|
||||
} threads;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <util/list.h>
|
||||
#include <sys/systick.h>
|
||||
|
||||
#include <io/usart.h>
|
||||
|
||||
|
||||
/***********************************
|
||||
rb2/link.h
|
||||
|
||||
RegisteredBus2 Interface Definitions
|
||||
|
||||
Paketorientierte Kommunikation via Serielle Verbindungen mit Adressierung
|
||||
|
||||
***********************************/
|
||||
|
||||
struct _rb2_link
|
||||
{
|
||||
list_t list;
|
||||
|
||||
uint8_t ring:1;
|
||||
uint8_t identrx:2;
|
||||
|
||||
uint16_t axmask;
|
||||
uint16_t idmask;
|
||||
|
||||
avrWAIT timeoutIdent;
|
||||
void *ptr;
|
||||
|
||||
rb2_telegram_buffer_t *
|
||||
(*receive) (RB2_LINK *link);
|
||||
uint8_t (*send) (RB2_LINK *link,rb2_telegram_buffer_t *telegram);
|
||||
};
|
||||
|
||||
struct _rb2_listed_link {
|
||||
list_t list;
|
||||
RB2_LINK *link;
|
||||
};
|
||||
|
||||
struct rb2_stream_link {
|
||||
RB2_LINK link;
|
||||
FILE *stream;
|
||||
list_t
|
||||
txqueue;
|
||||
|
||||
uint8_t rxptr;
|
||||
rb2_telegram_buffer_t *telegram;
|
||||
};
|
||||
|
||||
struct rb2_usart_link {
|
||||
RB2_LINK link;
|
||||
|
||||
uint8_t usart;
|
||||
|
||||
rb2_telegram_buffer_t *rx,
|
||||
*tx;
|
||||
|
||||
int rxptr;
|
||||
|
||||
list_t received;
|
||||
list_t send;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <util/list.h>
|
||||
|
||||
/***********************************
|
||||
rb2/proxy.h
|
||||
|
||||
RegisteredBus2 Interface Definitions
|
||||
|
||||
Paketorientierte Kommunikation via Serielle Verbindungen mit Adressierung
|
||||
|
||||
***********************************/
|
||||
|
||||
|
||||
struct _rb2_proxy;
|
||||
typedef struct _rb2_proxy RB2_PROXY;
|
||||
#define RB2_PROXY(ptr) ((RB2_PROXY*)(ptr))
|
||||
|
||||
|
||||
struct _rb2_proxy
|
||||
{
|
||||
list_t list;
|
||||
|
||||
uint8_t id;
|
||||
uint8_t (*register_proc)(RB2_REGISTER *reg,RB2_TELEGRAM *telegram);
|
||||
register_node_proc
|
||||
register_node_proc;
|
||||
|
||||
list_t segments;
|
||||
};
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/***********************************
|
||||
rb2/regbus.h
|
||||
|
||||
RegisteredBus2
|
||||
|
||||
Paketorientierte Kommunikation via Serielle Verbindungen mit Adressierung
|
||||
|
||||
***********************************/
|
||||
|
||||
struct _rb2_instance;
|
||||
typedef struct _rb2_instance RB2_INSTANCE;
|
||||
#define RB2_INSTANCE(ptr) ((RB2_INSTANCE*)(ptr))
|
||||
|
||||
#define RB2_IDENT_TIMEOUT 100000L // [us] Timeout für periodisches senden der IDENT Telegramme
|
||||
#define RB2_REQUEST_TIMEOUT 40L // [ms] Timeout für nicht bestätigte REQUESTs
|
||||
|
||||
#define RB2_MAGIC 0x77
|
||||
|
||||
// Festgelegte Ax Nummern
|
||||
#define RB_AX_LOCAL 0x00 // Lokales Axensystem
|
||||
#define RB_AX_MASTER 0x0D // Ring Master (z.B. Fernbedienung)
|
||||
|
||||
// Festgelegte Knoten Nummern
|
||||
#define RB_NODE_PROXY 0x00 // Knoten mit Anbindung an RING-BUS
|
||||
#define RB_NODE_BROADCAST 0x0F // Broadcast an alle Knoten
|
||||
|
||||
|
||||
struct _rb2_link;
|
||||
typedef struct _rb2_link RB2_LINK;
|
||||
typedef struct _rb2_link rb2_link_t;
|
||||
#define RB2_LINK(ptr) ((RB2_LINK*)(ptr))
|
||||
|
||||
struct _rb2_listed_link;
|
||||
typedef struct _rb2_listed_link RB2_LISTED_LINK;
|
||||
#define RB2_LISTED_LINK(ptr) ((RB2_LISTED_LINK*)(ptr))
|
||||
|
||||
struct rb2_stream_link;
|
||||
typedef struct rb2_stream_link RB2_STREAM_LINK;
|
||||
#define RB2_STREAM_LINK(ptr) ((RB2_STREAM_LINK*)(ptr))
|
||||
|
||||
struct rb2_usart_link;
|
||||
typedef struct rb2_usart_link RB2_USART_LINK;
|
||||
#define RB2_USART_LINK(ptr) ((RB2_USART_LINK*)(ptr))
|
||||
|
||||
struct rb2_can_link;
|
||||
typedef struct rb2_can_link RB2_CAN_LINK;
|
||||
#define RB2_CAN_LINK(ptr) ((RB2_CAN_LINK*)ptr)
|
||||
|
||||
|
||||
#include <rb2/telegram.h>
|
||||
#include <rb2/register.h>
|
||||
#include <rb2/link.h>
|
||||
#include <rb2/proxy.h>
|
||||
#include <rb2/instance.h>
|
||||
#include <rb2/api.h>
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <util/list.h>
|
||||
|
||||
// Register Data Types
|
||||
#define RDT_INT32 0x00 // 32Bit Integer
|
||||
#define RDT_FLOAT 0x01 // 32Bit Fliesskommazahl
|
||||
#define RDT_FP4816 0x02 // 64Bit Fixkommazahl (48.16).
|
||||
#define RDT_BINARY 0x03 // 32Bit Bitmaske
|
||||
#define RDT_FP1616 0x04 // 32Bit Fixkommazahl (16.16)
|
||||
|
||||
#define RDT_INT8 0x10 // 8Bit Integer -> auf Bus als 32bit
|
||||
#define RDT_INT16 0x20 // 16Bit Integer -> auf Bus als 32bit
|
||||
|
||||
#define RDT_8BIT 0x10
|
||||
#define RDT_16BIT 0x20
|
||||
#define RDT_WRITE 0x80 // Flag für register_proc(...), Schreibzugriff
|
||||
|
||||
// RegisterProc Return Values
|
||||
#define RPR_OK 0x00 // Kein Verarbeitungsfehler
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* register_node_proc(..) prototype: Callback to read/write register values of a "node"
|
||||
**/
|
||||
|
||||
#define RNPOP_READ 0x0000
|
||||
#define RNPOP_WRITE 0x0001
|
||||
|
||||
#define RNPOP_MASK 0x00FF
|
||||
#define RNPOP_IDMASK 0xFF00
|
||||
|
||||
typedef int (*register_node_proc)(int op,int regno,uint8_t *type,void *buffer);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
struct _rb2_register;
|
||||
typedef struct _rb2_register RB2_REGISTER;
|
||||
#define RB_REGISTER(ptr) ((RB2_REGISTER*)ptr)
|
||||
|
||||
struct _rb2_register_segment;
|
||||
typedef struct _rb2_register_segment RB2_RSEGMENT;
|
||||
#define RB2_RSEGMENT(ptr) ((RB2_RSEGMENT*)ptr)
|
||||
|
||||
|
||||
struct _rb2_register
|
||||
{
|
||||
uint16_t register_no;
|
||||
uint8_t register_type;
|
||||
|
||||
void *ptr;
|
||||
|
||||
};
|
||||
|
||||
struct _rb2_register_segment
|
||||
{
|
||||
list_t list;
|
||||
|
||||
struct _rb2_register
|
||||
registers[];
|
||||
};
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
#pragma once
|
||||
|
||||
#include <hwo/chksum.h>
|
||||
#include <sys/threads.h>
|
||||
|
||||
/***********************************
|
||||
rb2/regbus.h
|
||||
|
||||
RegisteredBus2
|
||||
|
||||
Paketorientierte Kommunikation via Serielle Verbindungen mit Adressierung
|
||||
|
||||
Paketformat ähnelt ServiceLink:
|
||||
|
||||
Byte Inhalt
|
||||
0 Magic 0x77
|
||||
1 empfänger
|
||||
2 sender
|
||||
3 flags
|
||||
|
||||
!flags.ident:
|
||||
4..5 register
|
||||
6..9 value
|
||||
flags.ident:
|
||||
4..5 endpunktmaske
|
||||
6 achse
|
||||
7..9 reserve
|
||||
|
||||
Alle:
|
||||
10..11 CHKSUM (SUM+XOR)
|
||||
|
||||
|
||||
***********************************/
|
||||
|
||||
struct _rb2_addr;
|
||||
struct _rb2_telegram;
|
||||
union _rb2_flags;
|
||||
struct _rb2_request;
|
||||
struct _rb2_listed_telegram;
|
||||
|
||||
typedef struct _rb2_addr RB2_ADDR;
|
||||
typedef struct _rb2_telegram RB2_TELEGRAM;
|
||||
typedef union _rb2_flags RB2_FLAGS;
|
||||
typedef struct _rb2_request RB2_REQUEST;
|
||||
|
||||
typedef struct _rb2_telegram rb2_telegram_t;
|
||||
typedef struct _rb2_telegram_buffer
|
||||
rb2_telegram_buffer_t;
|
||||
|
||||
|
||||
#define RB2_ADDR(ptr) ((RB2_ADDR*)(ptr))
|
||||
#define RB2_TELEGRAM(ptr) ((RB2_TELEGRAM*)(ptr))
|
||||
#define RB2_FLAGS(ptr) ((RB2_FLAGS*)(ptr))
|
||||
#define RB2_REQUEST(ptr) ((RB2_REQUEST*)(ptr))
|
||||
#define rb2_telegram_buffer_t(ptr) ((rb2_telegram_buffer_t*)(ptr))
|
||||
|
||||
struct _rb2_addr
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t ax:4;
|
||||
uint8_t node:4;
|
||||
};
|
||||
uint8_t addr;
|
||||
};
|
||||
};
|
||||
|
||||
union _rb2_flags
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t ident:1; // 1 = Ident Paket, 0 = Request/Response
|
||||
uint8_t response:1; // 1 = Antwort auf Request, 0 = Request
|
||||
uint8_t read:1; // 1 = Wert Lesen, 0 = Wert Schreiben
|
||||
uint8_t fail:1; // 1 = Anfrage fehlgeschlagen
|
||||
|
||||
uint8_t type:4; // 0 = Wert als Int32, 1 = Wert als float,...
|
||||
};
|
||||
uint8_t byte;
|
||||
};
|
||||
|
||||
struct _rb2_telegram
|
||||
{
|
||||
uint8_t magic;
|
||||
RB2_ADDR receiver;
|
||||
RB2_ADDR sender;
|
||||
RB2_FLAGS flags;
|
||||
union
|
||||
{
|
||||
struct // flags.ident = 0
|
||||
{
|
||||
uint16_t regno;
|
||||
union
|
||||
{
|
||||
int32_t i32;
|
||||
float f32;
|
||||
uint32_t ui32;
|
||||
};
|
||||
};
|
||||
struct // flags.ident = 1
|
||||
{
|
||||
uint16_t endpoints;
|
||||
uint8_t ax;
|
||||
};
|
||||
};
|
||||
CHKSUM chksum;
|
||||
};
|
||||
|
||||
|
||||
struct _rb2_telegram_buffer {
|
||||
list_t list;
|
||||
|
||||
rb2_link_t *link;
|
||||
|
||||
union {
|
||||
rb2_telegram_t telegram;
|
||||
unsigned char bytes[ sizeof( rb2_telegram_t ) ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
struct _rb2_request
|
||||
{
|
||||
list_t list;
|
||||
|
||||
uint8_t autofree:1;
|
||||
|
||||
THREAD *waiter;
|
||||
RB2_TELEGRAM telegram;
|
||||
};
|
||||
|
||||
typedef struct _rb2_request rb2_request_t;
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include_next <stddef.h>
|
||||
|
||||
typedef int wchar_t;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0L
|
||||
#endif
|
|
@ -0,0 +1,144 @@
|
|||
#pragma once
|
||||
|
||||
#if 0
|
||||
#include_next <stdio.h>
|
||||
#else
|
||||
|
||||
#define __HWO_STDIO__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <sys/threads.h>
|
||||
|
||||
struct _file;
|
||||
typedef struct _file FILE;
|
||||
|
||||
typedef int (*fdevput)(char,FILE*);
|
||||
typedef int (*fdevget)(FILE*);
|
||||
typedef int (*fdevreadblock)(FILE *,void *,int);
|
||||
typedef int (*fdevwriteblock)(FILE *,void *,int);
|
||||
|
||||
|
||||
#define _FDEV_ERR -1
|
||||
#define _FDEV_EOF -2
|
||||
|
||||
struct _file {
|
||||
fdevput put;
|
||||
fdevget get;
|
||||
fdevreadblock
|
||||
readblock;
|
||||
fdevwriteblock
|
||||
writeblock;
|
||||
|
||||
thread_t *notify;
|
||||
|
||||
void *udata;
|
||||
|
||||
char uappend[0];
|
||||
};
|
||||
|
||||
FILE* fdev_create(int appendsize,fdevput put,fdevget get,fdevreadblock readblock,fdevwriteblock writeblock);
|
||||
int fdev_notify(FILE* f,thread_t* notify);
|
||||
|
||||
|
||||
static inline int fputc(int ch, FILE *stream) {
|
||||
if ((stream == NULL) || (stream->put == NULL)) {
|
||||
return -1;
|
||||
};
|
||||
return stream->put( ch, stream );
|
||||
};
|
||||
|
||||
//#define fgetc(stream) (stream->get(stream))
|
||||
static inline int fgetc(FILE *stream) {
|
||||
int ch;
|
||||
if ((stream == NULL) || (stream->get == NULL)) {
|
||||
return -1;
|
||||
};
|
||||
|
||||
ch = stream->get( stream );
|
||||
return ch;
|
||||
};
|
||||
|
||||
#define fdev_get_udata(stream) (stream->udata)
|
||||
#define fdev_set_udata(stream,u) (stream->udata = u)
|
||||
|
||||
|
||||
#define fprintf(...)
|
||||
#define clearerr(stream)
|
||||
|
||||
int sprintf(char *dst,const char* fmt,...);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef __DONT_WRAP_STDLIB__
|
||||
|
||||
#include <hwo/threads.h>
|
||||
|
||||
#define IO_BLOCK_RD 0x01
|
||||
#define IO_BLOCK_WR 0x02
|
||||
#define IO_BLOCK (IO_BLOCK_RD | IO_BLOCK_WR)
|
||||
|
||||
FILE* dev_null(void);
|
||||
FILE* pipe(int size); // Erzeuge einen FIFO der Grösse <size> Bytes
|
||||
FILE* usart_open(int usart);
|
||||
|
||||
FILE* fdevopen_ts (int(*put)(char, FILE *),int(*get )(FILE *));
|
||||
int fclose_ts(FILE* file);
|
||||
|
||||
|
||||
#define fdevopen(__put,__get) fdevopen_ts(__put,__get)
|
||||
#define fclose(file) fclose_ts(file)
|
||||
|
||||
//#define fprintf(file,format,...) sprintf((char*)local_buffer(),format, ## __VA_ARGS__ ); fputs( (char*)local_buffer(), file )
|
||||
|
||||
static inline int fputsn(char *buffer,int len,FILE *stream)
|
||||
{
|
||||
int n;
|
||||
|
||||
if (stream){
|
||||
|
||||
if (stream->writeblock){
|
||||
return stream->writeblock(stream,buffer,len);
|
||||
};
|
||||
|
||||
for (n=0;n<len;n++)
|
||||
if (fputc( buffer[n], stream ))
|
||||
break;
|
||||
return n;
|
||||
};
|
||||
return -1;
|
||||
};
|
||||
|
||||
static inline int fputs(char *buffer,FILE *stream)
|
||||
{
|
||||
while (*(buffer++))
|
||||
fputc(*buffer, stream);
|
||||
return 0;
|
||||
};
|
||||
|
||||
static inline int read(FILE* stream,char *buffer,int len) {
|
||||
int l = len;
|
||||
while (l--)
|
||||
{
|
||||
uint8_t ch = fgetc( stream );
|
||||
if (ch == -1)
|
||||
break;
|
||||
*(buffer++) = ch;
|
||||
};
|
||||
return len - l;
|
||||
};
|
||||
|
||||
static inline int write(FILE* stream,char *buffer,int len) {
|
||||
int l = len;
|
||||
while (l--)
|
||||
{
|
||||
if (fputc( *(buffer++) , stream ))
|
||||
break;
|
||||
};
|
||||
return len - l;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include_next <stdlib.h>
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
void free_ts (void* ptr);
|
||||
void* malloc_ts (size_t size);
|
||||
void* calloc_ts (size_t _nele,size_t size);
|
||||
|
||||
#define malloc(size) malloc_ts(size)
|
||||
#define calloc(nele,size) calloc_ts(nele,size)
|
||||
#define free(size) free_ts(size)
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <rb2/regbus.h>
|
||||
#include <hwo/eeprom.h>
|
||||
|
||||
#ifndef ADC_CHANNELS
|
||||
#define ADC_CHANNELS 8
|
||||
#endif
|
||||
|
||||
struct adc_channel {
|
||||
#if !defined (__SIMPLE_ADC__)
|
||||
uint16_t raw;
|
||||
#else
|
||||
#define raw value
|
||||
#endif
|
||||
uint16_t value;
|
||||
};
|
||||
|
||||
#if !defined (__SIMPLE_ADC__)
|
||||
|
||||
struct adc_params {
|
||||
uint16_t min;
|
||||
uint16_t max;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
struct adc {
|
||||
struct adc_channel channels[ ADC_CHANNELS ];
|
||||
|
||||
#if !defined (__SIMPLE_ADC__)
|
||||
union {
|
||||
EEPROM eeprom;
|
||||
struct adc_params params[ ADC_CHANNELS ];
|
||||
};
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#if !defined (__SIMPLE_ADC__)
|
||||
extern uint8_t _adc_bank;
|
||||
#endif
|
||||
|
||||
extern struct adc adc;
|
||||
|
||||
void adc_init(uint8_t bank);
|
||||
void adc_reinit(void);
|
||||
void adc_save(void);
|
||||
|
||||
static inline uint16_t adc_value(uint8_t ch) { if (ch < ADC_CHANNELS) return adc.channels[ch].value; return 0; };
|
||||
|
||||
#if !defined (__SIMPLE_ADC__)
|
||||
|
||||
void adc_set_limit_min(uint8_t ch,uint16_t limit);
|
||||
void adc_set_limit_max(uint8_t ch,uint16_t limit);
|
||||
void adc_set_limit_range(uint8_t ch,uint16_t limit);
|
||||
|
||||
uint16_t adc_get_limit_min(uint8_t ch);
|
||||
uint16_t adc_get_limit_max(uint8_t ch);
|
||||
uint16_t adc_get_limit_range(uint8_t ch);
|
||||
|
||||
uint8_t adc_register_proc(RB2_REGISTER *reg,RB2_TELEGRAM *telegram);
|
||||
int adc_node_proc(int op,int regno,uint8_t *type,void *buffer);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#pragma once
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <cpu/cpu.h>
|
||||
#include <sys/dbg.h>
|
||||
|
||||
extern intptr_t _dbg_atomic_ip;
|
||||
|
||||
|
||||
#define ATOMIC \
|
||||
inline void __restoresreg(uint8_t *sr) { SREG = *sr; rt_dbg->atomic_ip = 0; }; \
|
||||
uint8_t __sreg __attribute__((__cleanup__(__restoresreg))) = SREG; \
|
||||
cli(); \
|
||||
rt_dbg->atomic_ip = getPC();
|
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
/**
|
||||
* sys/arch/spinlock.h AVR Spinlock implementation
|
||||
**/
|
||||
|
||||
#include <sys/cpu.h>
|
||||
#include <sys/atomic.h>
|
||||
#include <sys/trace.h>
|
||||
|
||||
#define SPINLOCK_INIT_UNLOCKED 0x00
|
||||
#define SPINLOCK(name) spinlock_t name = SPINLOCK_INIT_UNLOCKED
|
||||
|
||||
typedef uint8_t spinlock_t;
|
||||
|
||||
void spinlock_lock(spinlock_t *spinlock);
|
||||
void spinlock_release(spinlock_t *spinlock);
|
||||
void spinlock_lock_irq(spinlock_t *spinlock,cpustate_t *state);
|
||||
void spinlock_release_irq(spinlock_t *spinlock,cpustate_t *state);
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <cpu/systick.h>
|
||||
|
||||
/* Interface to CPU Low Level Routines */
|
||||
void systick_timer_init(uint32_t systick_us);
|
||||
|
||||
#define avrWAIT ST_WAIT
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
#include <hwo/utils.h>
|
||||
|
||||
#if defined(DEBUG_ASSERTIONS)
|
||||
#pragma message "ASSERTIONS: DEBUG MODE"
|
||||
|
||||
|
||||
void _assert(int result,int16_t loc);
|
||||
void _assert_read(void);
|
||||
|
||||
static inline int _noassert(int r,int16_t loc) {
|
||||
if (r<0)
|
||||
{
|
||||
_assert( r, loc );
|
||||
};
|
||||
return r;
|
||||
};
|
||||
|
||||
int32_t _assert_current(void);
|
||||
int32_t _assert_current_error(void);
|
||||
|
||||
#define assert2(f,p) { int r = (f); if (r<0) { _assert( r, p ); return r; }; }
|
||||
#define assert(f) assert2( f, getPC() )
|
||||
#define noassert(f) _noassert( (f), getPC() )
|
||||
|
||||
#else
|
||||
|
||||
#define assert2(f,p) (f)
|
||||
#define assert(f) (f)
|
||||
#define noassert(f) (f)
|
||||
|
||||
#define _assert_read() (0)
|
||||
#define _assert_current_error() (0)
|
||||
#define _assert_current() (0)
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <sys/arch/atomic.h>
|
||||
|
||||
#define ATOM_SET_BIT(atom,bit) { \
|
||||
ATOMIC \
|
||||
atom |= (1L<<bit); }
|
||||
|
||||
#define ATOM_CLEAR_BIT(atom,bit) { \
|
||||
ATOMIC \
|
||||
atom &= ~(1L<<bit); }
|
||||
|
||||
#define ATOMIC_SET(atom,value) { \
|
||||
ATOMIC \
|
||||
atom = value; }
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
#define BL_CMD_NOOP 0x00 // Noop
|
||||
#define BL_CMD_ERASE_FLASH 0x10 // Applikationsflash löschen
|
||||
#define BL_CMD_WRITE_FLASH 0x11 // Daten in Flash schreiben
|
||||
#define BL_CMD_SET_FLASH_PTR 0x12 // Setze den Schreibpointer für Flashvorgänge (impliziert BL_CMD_FLUSH)
|
||||
#define BL_CMD_FLUSH 0x13 // Flash Schreibvorgang abschliessen (übrige Daten im Buffer schreiben)
|
||||
|
||||
#define BL_CMD_GET_FLASH_PARA 0x18 // Frage nach Daten des FLASH
|
||||
|
||||
#define BL_CMD_REPLY 0x40
|
||||
|
||||
struct bl_cmd
|
||||
{
|
||||
uint8_t cmd;
|
||||
uint8_t len;
|
||||
uint8_t chk;
|
||||
char buffer[32];
|
||||
};
|
||||
|
||||
uint8_t bl_send(FILE *stream,struct bl_cmd *cmd);
|
||||
uint8_t bl_recv(FILE *stream,struct bl_cmd *cmd);
|
||||
|
||||
void bl_boot_application(void);
|
||||
uint8_t bootloader(FILE *stream);
|
||||
|
||||
|
||||
#define BL_MCU_AT90USB1286 0x20
|
||||
#define BL_MCU_AT90CAN128 0x21
|
||||
#define BL_MCU_ATMEGA1284 0x22
|
||||
#define BL_MCU_ATMEGA32U4 0x23
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct bootsys {
|
||||
uint32_t version;
|
||||
|
||||
union {
|
||||
uint32_t flags;
|
||||
struct {
|
||||
uint32_t flashimage:1; // Image für Update steht bereit
|
||||
uint32_t flashed:1; // Kennung Update erfolgreich
|
||||
};
|
||||
};
|
||||
|
||||
uint32_t reserve[14];
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
#define require( value ) { int r = (value); if (r < 0) return r; }
|
||||
#define tolerate( state, result ) { int r = (result); if (r < 0) state = r; }
|
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint32_t __freq_cpu;
|
||||
typedef uint8_t cpustate_t;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
intptr_t atomic_ip;
|
||||
intptr_t spinlock_ip;
|
||||
intptr_t last_vect[4];
|
||||
intptr_t last_late_vect[4];
|
||||
} rt_dbg_t;
|
||||
|
||||
#define rt_dbg ((rt_dbg_t*)((int)__malloc_heap_end - sizeof( rt_dbg_t ) ) )
|
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
#define ESUCCESS 0
|
||||
#define ENULLPTR 1
|
||||
#define EPARAM 2
|
||||
#define ETIMEOUT 3
|
||||
#define EHWTIMEOUT 4
|
||||
#define EBUSY 5
|
||||
#define EFAIL 6
|
||||
#define ENOMEM 7
|
||||
#define ENOFILE 8
|
||||
#define ESHORT 9
|
||||
#define ECRC 10
|
||||
#define EUNKNOWN 11
|
||||
#define EREPEATED 12
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/sysevents.h>
|
||||
|
||||
#include <util/list.h>
|
||||
#include <hwo/threads.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define EV_FLAG_AUTOFREE 0x01
|
||||
|
||||
struct avr_event
|
||||
{
|
||||
list_t list;
|
||||
|
||||
uint8_t flags;
|
||||
|
||||
uint32_t event; // Ereigniscode
|
||||
uint32_t parm1, // Parameter 1
|
||||
parm2; // Parameter 2
|
||||
|
||||
void *ptr; // Ptr Parameter
|
||||
|
||||
uint64_t time; // Wann wurde das Ereignis gesetzt
|
||||
};
|
||||
|
||||
typedef struct avr_event avrEVENT;
|
||||
typedef struct avr_event EVENT;
|
||||
|
||||
#define EVENT(ptr) ((EVENT*)ptr)
|
||||
|
||||
|
||||
extern list_t _ev_head;
|
||||
extern EVENT *_ev_cleanup;
|
||||
|
||||
extern THREAD *eventWaiter;
|
||||
|
||||
int event_append(EVENT *event);
|
||||
int event_push(uint32_t event,uint32_t p1,uint32_t p2,void* ptr);
|
||||
void event_cleanup(void);
|
||||
|
||||
avrEVENT* event_wait(uint32_t maxwait); // Nächstes Ereignis holen, warte maximal <maxwait> us dann return NULL
|
||||
avrEVENT* event_pull(void); // Nächstes Ereignis holen, blockiert immer bis Ereignis vorhanden
|
||||
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/assert.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
struct fastfile;
|
||||
typedef struct fastfile fastfile_t;
|
||||
|
||||
struct fastfile {
|
||||
int size;
|
||||
|
||||
struct {
|
||||
int (*seek) (fastfile_t *ff,int position);
|
||||
int (*tell) (fastfile_t *ff);
|
||||
int (*read) (fastfile_t *ff,void *buffer,int len);
|
||||
int (*write)(fastfile_t *ff,void *buffer,int len);
|
||||
int (*close)(fastfile_t *ff);
|
||||
} ops;
|
||||
};
|
||||
|
||||
|
||||
static inline int ff_seek(fastfile_t *ff,int position) {
|
||||
if (!ff || !ff->ops.seek)
|
||||
return -ENULLPTR;
|
||||
return ff->ops.seek(ff,position);
|
||||
};
|
||||
|
||||
static inline int ff_tell(fastfile_t *ff) {
|
||||
if (!ff || !ff->ops.tell)
|
||||
return -ENULLPTR;
|
||||
return ff->ops.tell(ff);
|
||||
};
|
||||
|
||||
static inline int ff_read(fastfile_t *ff,void *buffer,int len) {
|
||||
if (!ff || !ff->ops.read)
|
||||
return -ENULLPTR;
|
||||
return ff->ops.read(ff,buffer,len);
|
||||
};
|
||||
|
||||
static inline int ff_write(fastfile_t *ff,void *buffer,int len) {
|
||||
if (!ff || !ff->ops.write)
|
||||
return -ENULLPTR;
|
||||
return ff->ops.write(ff,buffer,len);
|
||||
};
|
||||
|
||||
static inline int ff_close(fastfile_t *ff) {
|
||||
if (!ff || !ff->ops.close)
|
||||
return -ENULLPTR;
|
||||
return ff->ops.close(ff);
|
||||
};
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <rb2/regbus.h>
|
||||
|
||||
#define EEF_BOOTSYS 0x0000
|
||||
#define EEF_FLASHIMG 0x0001
|
||||
#define EEF_BOOTPARAM 0x0002
|
||||
|
||||
struct eefile {
|
||||
int32_t name;
|
||||
int32_t size;
|
||||
};
|
||||
|
||||
|
||||
struct _i2cee {
|
||||
uint8_t emask;
|
||||
|
||||
|
||||
int32_t size;
|
||||
};
|
||||
|
||||
extern struct _i2cee i2cee;
|
||||
|
||||
|
||||
uint8_t i2cee_register_proc(RB2_REGISTER *reg,RB2_TELEGRAM *telegram);
|
||||
|
||||
void i2cee_identify(void); // Identifiziere externe EEPROMS
|
||||
int32_t i2cee_size(void); // Gibt die Gesamtgröße der externen EEPROMS zurück
|
||||
|
||||
int i2cee_load(int32_t base,void *p,int16_t len);
|
||||
int i2cee_save(int32_t base,void *p,int16_t len);
|
||||
|
||||
int32_t i2cee_defrag(void);
|
||||
int32_t i2cee_create_file(int32_t name,int32_t size);
|
||||
|
||||
|
||||
typedef struct {
|
||||
int32_t tag,
|
||||
offset,
|
||||
size,
|
||||
reserve;
|
||||
} part_t;
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/threads.h>
|
||||
|
||||
struct mutex
|
||||
{
|
||||
uint8_t locked;
|
||||
THREAD *thread;
|
||||
};
|
||||
|
||||
typedef struct mutex MUTEX;
|
||||
|
||||
APICALL mutex_lock(MUTEX *mutex);
|
||||
uint8_t mutex_try_lock(MUTEX *mutex);
|
||||
|
||||
APICALL mutex_lock_timeout(MUTEX *mutex,int32_t timeout);
|
||||
|
||||
APICALL mutex_release(MUTEX *mutex);
|
||||
|
||||
MUTEX* mutex_lock_indirect(volatile MUTEX *mutex);
|
||||
void mutex_release_indirect(volatile MUTEX **mutex);
|
||||
|
||||
|
||||
#define MUTEXED(pmutex) \
|
||||
volatile MUTEX *___mutex __attribute__((__cleanup__(mutex_release_indirect))) = mutex_lock_indirect(pmutex);
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <fixpoint/fp4816.h>
|
||||
|
||||
#define POF_SET_ON 0x01 // Ein Signal einschalten bei output_on
|
||||
#define POF_SET_OFF 0x02 // Ein Signal ausschalten bei output_off
|
||||
#define POF_SENS_OC 0x04 // Überlastsignal an Pin
|
||||
#define POF_SENS_LOAD 0x08 // Lastmessung an ADC
|
||||
#define POF_TRIGGER_ON 0x10 // Eine Signalflanke erzeugen bei output_on
|
||||
#define POF_TRIGGER_OFF 0x20 // Eine Signalflanke erzeugen bei output_off
|
||||
|
||||
#define POF_ALL (POF_SET_ON | POF_SET_OFF | POF_SENS_OC | POF_SENS_LOAD)
|
||||
|
||||
#define POS_OVERCURRENT 0x01 // Fehler: Überlast
|
||||
#define POS_CTRL_ON 0x10 // Status: Eingang wurde eingeschaltet
|
||||
#define POS_CTRL_OFF 0x20 // Status: Eingang wurde ausgeschaltet
|
||||
|
||||
|
||||
|
||||
|
||||
static inline void trigger_pos(volatile unsigned char *reg,uint8_t bit){
|
||||
volatile uint8_t n;
|
||||
|
||||
*reg |= (1<<bit);
|
||||
for (n=0;n<4;n++);
|
||||
*reg &= (1<<bit);
|
||||
};
|
||||
|
||||
static inline void trigger_neg(volatile unsigned char *reg,uint8_t bit){
|
||||
volatile uint8_t n;
|
||||
|
||||
*reg &= ~(1<<bit);
|
||||
for (n=0;n<4;n++);
|
||||
*reg |= (1<<bit);
|
||||
};
|
||||
|
||||
|
||||
struct _protected_output {
|
||||
uint8_t features; // Unterstützte Funktionen
|
||||
uint8_t inverse; // Invertierte Funktionen (Active-LOW)
|
||||
uint8_t bit_on:4; // Welches Bit in reg_on schaltet Ausgang ein?
|
||||
uint8_t bit_off:4; // Welches schaltet aus?
|
||||
uint8_t bit_sens:4; // Welches signalisiert überlast?
|
||||
uint8_t sens_chan:4; // Welcher ADC Kanal misst Strom?
|
||||
|
||||
volatile unsigned char
|
||||
*reg_on, // Register für ein
|
||||
*reg_off, // register für aus
|
||||
*reg_sens; // Register für überlast
|
||||
|
||||
fp4816_t sens_offset, // Parameter der Strommessung (ADC(x) = 0..1,0
|
||||
sens_scale; // I = (ADC(sens_chan) + sens_offset) * sens_scale
|
||||
|
||||
int32_t status;
|
||||
};
|
||||
typedef struct _protected_output digout_t;
|
||||
|
||||
void outputs_init (digout_t *outputs,int len); // Subsystem initialisieren
|
||||
|
||||
int8_t outputs_num (void); // Ermittelt die Zahl der bekannten Ausgänge
|
||||
|
||||
void output_on (int no); // Ausgang AN
|
||||
void output_off (int no); // Ausgang AUS
|
||||
|
||||
static inline
|
||||
void output_set (int no,int8_t state) { if (state) output_on(no); else output_off(no); };
|
||||
|
||||
int32_t output_read (int no); // Ausgangszustand LESEN
|
||||
fp4816_t
|
||||
output_current (int no); // Aktuelle Last lesen (in A)
|
||||
|
||||
void output_failed_overcurrent(int no); // Mitteilung an SubSystem: Überstrom erkannt
|
||||
|
||||
static inline void outputs_off(void) { uint8_t i; for (i=0;i<outputs_num();i++) output_off(i); };
|
||||
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
#pragma once
|
||||
|
||||
#include <hwo/eeprom.h>
|
||||
#include <rb2/regbus.h>
|
||||
|
||||
#include <sys/timer.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#define ASSERT_BUFFER_LEN 8
|
||||
|
||||
#define RTA_USER0 0x01
|
||||
#define RTA_USER1 0x02
|
||||
#define RTA_SERVICE0 0x04
|
||||
#define RTA_SERVICE1 0x08
|
||||
#define RTA_SERVICE2 0x10
|
||||
#define RTA_MANUFACT0 0x20
|
||||
#define RTA_MANUFACT1 0x40
|
||||
#define RTA_DEVELOPER 0x80
|
||||
|
||||
union spaccessmask {
|
||||
uint8_t code;
|
||||
struct {
|
||||
uint8_t user0:1;
|
||||
uint8_t user1:1;
|
||||
uint8_t service0:1;
|
||||
uint8_t service1:1;
|
||||
uint8_t service2:1;
|
||||
uint8_t manufact0:1;
|
||||
uint8_t manufact1:1;
|
||||
uint8_t developer:1;
|
||||
};
|
||||
};
|
||||
|
||||
union spaccesscode {
|
||||
int32_t code;
|
||||
uint8_t code8[4];
|
||||
struct {
|
||||
uint16_t servicepartner;
|
||||
union spaccessmask
|
||||
accessmask;
|
||||
uint8_t passcode;
|
||||
};
|
||||
};
|
||||
|
||||
union rt_flags {
|
||||
int32_t code;
|
||||
struct {
|
||||
int32_t eeprom_corrupt:1; // EEPROM konnte nicht geladen werden
|
||||
int32_t is_running:1; // Aktueller Status "RUNNING"
|
||||
int32_t service_pending:1; // Serviceintervall steht an (next_service <= secs_running)
|
||||
};
|
||||
};
|
||||
|
||||
union rt_serial {
|
||||
int32_t code;
|
||||
struct {
|
||||
int32_t serial:28;
|
||||
int32_t family:4;
|
||||
};
|
||||
};
|
||||
|
||||
union rt_eeprom {
|
||||
avrEEPROM eeprom;
|
||||
struct
|
||||
{
|
||||
union rt_serial
|
||||
serial; // Seriennummer der Elektronik
|
||||
int32_t secs_powered; // Sekunden an Versorgung
|
||||
int32_t secs_running; // Sekunden mit eingeschalteter Endstufe
|
||||
int32_t count_poweron; // Anzahl PowerOn
|
||||
int32_t next_service; // Zeitpunkt nächster Service
|
||||
int32_t service_partner; // ServicePartner ID bei letzter Anpassung next_service
|
||||
int32_t service_set_time; // Zeitpunkt der letzten Änderung next_service
|
||||
int32_t last_auth; // ServicePartner ID des letzten authentifizierten ServicePartners
|
||||
};
|
||||
int32_t list[8];
|
||||
};
|
||||
|
||||
struct rt_ram {
|
||||
union rt_flags flags;
|
||||
union spaccesscode
|
||||
accesscode;
|
||||
|
||||
THREAD *rt_thread;
|
||||
|
||||
union rt_eeprom
|
||||
eeprom;
|
||||
|
||||
struct {
|
||||
int32_t hardware_id,
|
||||
hardware_revision,
|
||||
software_revision,
|
||||
functional_groups;
|
||||
} identity;
|
||||
|
||||
uint32_t unix_timeoffset;
|
||||
unix_time_changing_t
|
||||
unix_time_changing;
|
||||
|
||||
SYSTIMER *timer;
|
||||
|
||||
systick_t secs_last;
|
||||
systick_t secs_current,
|
||||
secs_gone;
|
||||
|
||||
uint8_t bank;
|
||||
|
||||
struct {
|
||||
/* asserts.next: nächster freier Slot
|
||||
* asserts.read: nächster zu lesender Slot
|
||||
*/
|
||||
int8_t next,
|
||||
read;
|
||||
struct {
|
||||
int16_t location;
|
||||
int16_t res0;
|
||||
int error;
|
||||
} buffer[ ASSERT_BUFFER_LEN ];
|
||||
} asserts;
|
||||
|
||||
};
|
||||
|
||||
#define RT_REVISION(version,revhigh,revlow) ( ((((int32_t)version) & 0xFFFF)<<16) | ((((int32_t)revhigh) & 0xFF)<<8) | (((int32_t)revlow)& 0xFF) )
|
||||
|
||||
|
||||
extern volatile struct rt_ram rt_ram;
|
||||
|
||||
static inline void runtime_set_identity(int32_t hwid,int32_t hwrev,int32_t swrev,int32_t functional) {
|
||||
rt_ram.identity.hardware_id = hwid;
|
||||
rt_ram.identity.hardware_revision = hwrev;
|
||||
rt_ram.identity.software_revision = swrev;
|
||||
rt_ram.identity.functional_groups = functional;
|
||||
};
|
||||
|
||||
void runtime_signal(void);
|
||||
void runtime_start(int16_t bank);
|
||||
|
||||
void runtime_set_running(uint8_t running);
|
||||
|
||||
static inline uint8_t runtime_is_running(void) { return rt_ram.flags.is_running; };
|
||||
static inline volatile struct rt_ram*
|
||||
runtime_get_buffer(void) { return &rt_ram; };
|
||||
|
||||
static inline void unixtime_set_changing(unix_time_changing_t changing) {
|
||||
ATOMIC
|
||||
rt_ram.unix_time_changing = changing;
|
||||
};
|
||||
|
||||
void t_runtime(void *arg);
|
||||
int rt_node_proc(int op,int regno,uint8_t *type,void *buffer);
|
||||
uint8_t runtime_register_proc(RB2_REGISTER *reg,RB2_TELEGRAM *telegram);
|
||||
|
||||
static inline uint8_t rt_authorized(uint8_t mask) { return ((rt_ram.accesscode.accessmask.code & mask) == mask) ? -1 : 0; };
|
||||
uint8_t rt_authenticate(int32_t token);
|
|
@ -0,0 +1,41 @@
|
|||
#pragma once
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
hwo/intern/spi.h
|
||||
|
||||
Internal Structure for SPI Device Handling
|
||||
|
||||
************************************************************************************/
|
||||
#include <stdint.h>
|
||||
|
||||
#define SPI_LSBFIRST 0x0001
|
||||
#define SPI_MASTER 0x0002
|
||||
#define SPI_IDLE_CLKHIGH 0x0004
|
||||
#define SPI_PHASE_TRAILING 0x0008
|
||||
|
||||
/*** spi_configure(...)
|
||||
Schnittstelle konfigurieren und aktivieren
|
||||
***/
|
||||
int spi_configure(uint32_t clk,uint32_t flags);
|
||||
|
||||
/*** spi_deconfigure(...)
|
||||
Schnittstelle abschalten
|
||||
***/
|
||||
int spi_deconfigure(void);
|
||||
|
||||
/*** spi_transmit(...)
|
||||
Daten senden/empfangen.
|
||||
|
||||
Inhalt von <tx> wird gesendet, Inhalt von <rx> enthält nach Aufruf empfangene Daten.
|
||||
<tx> und <rx> dürfen identisch sein, der Treiber muss sicherstellen, dass erst das zu sendende Byte gelesen wird, bevor das empfangene geschrieben wird.
|
||||
***/
|
||||
int spi_transmit(void *tx,void *rx,uint8_t len);
|
||||
|
||||
|
||||
int spi_transmit_ex(uint8_t chip,void *tx,void *rx,uint8_t len);
|
||||
int spi_set_select(void(*select)(uint8_t chip));
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/arch/spinlock.h>
|
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
#define EV_SYS_BUSDISCONNECT 0x80001000l //(p1: 0 = link, 1 = ring)
|
||||
#define EV_SYS_BUSCONNECT 0x80001001l //(p1: 0 = link, 1 = ring)
|
||||
#define EV_SYS_BUSCRCFAIL 0x80001002l
|
||||
#define EV_SYS_BUSMISSIDENT 0x80001003l // Ident on Ringbus was lost...
|
||||
|
||||
#define EV_SYS_TIMER 0x80001010l // sys_timer event
|
||||
|
||||
#define EV_SYS_USBCONNECT 0x80002000l // USB connected
|
||||
#define EV_SYS_USBDISCONNECT 0x80002001l // USB disconnected
|
||||
#define EV_SYS_USBCONFIGURED 0x80002002l // USB Configuration changed
|
||||
|
||||
|
||||
#define EV_SYS_DEBUGREQUEST 0x8000FFFFl // Debug Request
|
||||
|
||||
#define TIMERID_SYS_RUNTIME 0x80000000l
|
||||
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/cpu.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
typedef uint64_t systick_t;
|
||||
|
||||
struct _systick_wait
|
||||
{
|
||||
systick_t target;
|
||||
};
|
||||
typedef struct _systick_wait ST_WAIT;
|
||||
|
||||
typedef void (*systick_handler)(systick_t ticks);
|
||||
|
||||
extern volatile uint32_t _systick_secs; // system uptime in [s]
|
||||
extern volatile uint32_t _systick_sec_frac;
|
||||
|
||||
extern volatile systick_t _systick_ticks; // system uptime in [us]
|
||||
|
||||
extern systick_t _systick_us; // Systick Interval in [us]
|
||||
|
||||
extern uint32_t _st_cycles_per_intervall __attribute__((weak));
|
||||
|
||||
|
||||
void systick_init(systick_t systick_us);
|
||||
void systick(void);
|
||||
void systick_set_us(systick_t tickus);
|
||||
|
||||
int systick_correct(int32_t correct);
|
||||
|
||||
systick_t systick_ticks(void);
|
||||
uint32_t systick_secs(void);
|
||||
|
||||
void systick_set_handler(systick_handler handler);
|
||||
void systick_set_handler_sec(systick_handler handler);
|
||||
|
||||
void wait_ms(uint32_t ms);
|
||||
|
||||
void wait_async_set(ST_WAIT* wait,systick_t us);
|
||||
uint8_t wait_async_test(ST_WAIT* wait);
|
||||
|
||||
/* call_sys_ctx(...) Rufe Funktion nach Ändern von SP auf CTX ST */
|
||||
void call_sys_ctx(void (*proc)(void));
|
||||
|
||||
#if defined(__DEBUG_PLATFORM__)
|
||||
|
||||
#define VECT(__vect) \
|
||||
void _vect_##__vect(void); \
|
||||
ISR(__vect){ \
|
||||
rt_dbg->last_vect[3] = rt_dbg->last_vect[2]; \
|
||||
rt_dbg->last_vect[2] = rt_dbg->last_vect[1]; \
|
||||
rt_dbg->last_vect[1] = rt_dbg->last_vect[0]; \
|
||||
rt_dbg->last_vect[0] = (int)__vect; \
|
||||
call_sys_ctx( _vect_##__vect ); \
|
||||
}; \
|
||||
void _vect_##__vect(void)
|
||||
|
||||
#else
|
||||
|
||||
#define VECT(__vect) \
|
||||
void _vect_##__vect(void); \
|
||||
ISR(__vect){ \
|
||||
call_sys_ctx( _vect_##__vect ); \
|
||||
}; \
|
||||
void _vect_##__vect(void)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#include <sys/arch/systick.h>
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
#pragma once
|
||||
|
||||
/***************************************
|
||||
|
||||
threads.h
|
||||
|
||||
Multithreading for AVR8
|
||||
|
||||
yield() must be called with enabled interrupts! (SEI)
|
||||
|
||||
|
||||
***************************************/
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include <hwo/stack.h>
|
||||
#include <hwo/systick.h>
|
||||
#include <sys/atomic.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <util/list.h>
|
||||
|
||||
typedef void (*threadstart)(void *arg);
|
||||
|
||||
/* Thread Priorities */
|
||||
#define TP_HIGH 0x00
|
||||
#define TP_NORMAL 0x01
|
||||
#define TP_LOW 0x02
|
||||
#define TP_IDLE 0x03
|
||||
|
||||
// thread flags...
|
||||
#define THREAD_HALT 0x0001
|
||||
#define THREAD_WAIT 0x0002
|
||||
|
||||
#define THREAD_IDLE 0x0100
|
||||
#define THREAD_REMOVE 0x0200
|
||||
|
||||
struct _hwo_thread
|
||||
{
|
||||
list_t list; // Thread Liste
|
||||
list_t list_queue; // Priority Liste
|
||||
list_t list_periodic; // Liste aller periodisch geplanten Threads
|
||||
|
||||
threadstart start;
|
||||
void* arg;
|
||||
|
||||
union {
|
||||
uint16_t flags;
|
||||
struct {
|
||||
uint16_t halt:1;
|
||||
uint16_t wait:1;
|
||||
uint16_t reserve0:6;
|
||||
uint16_t idle:1;
|
||||
uint16_t remove:1;
|
||||
uint16_t periodic_miss:1;
|
||||
uint16_t warn_stack:1;
|
||||
uint16_t reserve1:2;
|
||||
uint16_t priority:2;
|
||||
};
|
||||
};
|
||||
|
||||
struct {
|
||||
int size;
|
||||
|
||||
uint8_t *base;
|
||||
uint8_t *stackpointer;
|
||||
|
||||
int16_t min_free; // Kleinster festgestellter verfügbarer Stackspeicher
|
||||
} stack;
|
||||
|
||||
struct {
|
||||
systick_t timeout; // Zeitpunkt um aus tfWAIT zu erwachen...
|
||||
int32_t periodic; // [us]
|
||||
int32_t periode; // Periode Counter (periodic..0)
|
||||
};
|
||||
|
||||
struct {
|
||||
int32_t scheduled,
|
||||
periodic_misses;
|
||||
sched_time_t
|
||||
scheduled_time;
|
||||
} statistic;
|
||||
|
||||
};
|
||||
typedef struct _hwo_thread THREAD;
|
||||
#define THREAD(ptr) ((THREAD*)ptr)
|
||||
typedef struct _hwo_thread thread_t;
|
||||
#define thread_t(ptr) ((thread_t*)ptr)
|
||||
|
||||
/* _threading_threads: Global Thread List*/
|
||||
extern list_t _threading_threads;
|
||||
/* _threading_queues: Thread Queues by Priority */
|
||||
extern list_t _threading_queues[4];
|
||||
|
||||
/* _threading_current: Currently active/scheduled Thread */
|
||||
extern THREAD* _threading_current;
|
||||
|
||||
#define current_thread() (_threading_current)
|
||||
|
||||
|
||||
void schedule_thread(THREAD *thread); // Thread einplanen
|
||||
void unschedule_thread(THREAD *thread); // Thread aus Planung entfernen
|
||||
|
||||
void st_schedule(void); // SysTick: periodische Threadplaung
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ctxswitch(void); // context switcher
|
||||
uint8_t* ctxsched(uint8_t* oldstack); // scheduler
|
||||
void ctx_add_thread(THREAD* t);
|
||||
void ctx_remove_thread(THREAD* t);
|
||||
|
||||
THREAD* thread_alloc(threadstart start,void* arg,uint16_t stacksize);
|
||||
void thread_starter(void);
|
||||
int thread_kill(THREAD* t);
|
||||
|
||||
void thread_sleep_irq(THREAD* thread);
|
||||
void thread_wake(THREAD* thread);
|
||||
|
||||
void thread_set_periodic(THREAD* thread,int32_t us);
|
||||
void thread_set_priority(THREAD* thread,uint8_t prio);
|
||||
|
||||
void yield(void);
|
||||
|
||||
static inline void thread_sleep(THREAD* thread)
|
||||
{
|
||||
ATOMIC
|
||||
thread_sleep_irq(thread);
|
||||
yield();
|
||||
};
|
||||
|
||||
#define avrThread THREAD
|
||||
|
||||
/* @brief Auflösung des Systick Timers */
|
||||
extern int32_t _ts_timer_resolution;
|
||||
/* @brief CPU Takte pro Systick Timer Inkrement */
|
||||
extern int32_t _ts_timer_cycles_per_increment;
|
||||
/* @brief Letzter gemeldeter Zählerstand*/
|
||||
extern int32_t _ts_timer_last_counter_value;
|
||||
/* @brief Systick Timer Inkrmenente / Sekunde */
|
||||
extern int32_t _ts_timer_increments_per_second;
|
||||
|
||||
/* @brief Rechenzeit für Systick */
|
||||
extern sched_time_t _ts_sys_time,
|
||||
_ts_irq_time;
|
||||
|
||||
extern int16_t _st_lag_current,
|
||||
_st_lag_min,
|
||||
_st_lag_max;
|
||||
|
||||
|
||||
#ifndef _st_counter
|
||||
#define _st_counter() 0
|
||||
#endif // _st_counter
|
||||
|
||||
/* @brief retrieve momentary systick counter value
|
||||
*/
|
||||
static inline uint32_t st_current_counter(void){
|
||||
int32_t cv = _st_counter();
|
||||
if (_ts_timer_last_counter_value > cv){
|
||||
cv += _ts_timer_resolution;
|
||||
};
|
||||
_ts_timer_last_counter_value = cv;
|
||||
return cv;
|
||||
};
|
||||
|
||||
static inline void st_reset_last_counter(void){
|
||||
_ts_timer_last_counter_value = 0;
|
||||
};
|
||||
|
||||
void thread_stat_schedule (sched_time_t *sched_time);
|
||||
void thread_stat_unschedule (sched_time_t *sched_time);
|
||||
void thread_stat_systick (sched_time_t *sched_time);
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int32_t time_t;
|
||||
|
||||
struct datetime {
|
||||
uint16_t year;
|
||||
uint8_t month; // 0..11
|
||||
uint8_t day; // 0..30
|
||||
uint8_t hour; // 0..23
|
||||
uint8_t minute; // 0..59
|
||||
uint8_t second; // 0..59
|
||||
};
|
||||
|
||||
typedef struct datetime datetime_t;
|
||||
|
||||
#define UTCH_CHECK 0
|
||||
#define UTCH_CHANGING 1
|
||||
#define UTCH_CHANGED 2
|
||||
|
||||
|
||||
typedef int (*unix_time_changing_t)(int step,time_t oldtime,time_t newtime);
|
||||
|
||||
|
||||
int unix2datetime(time_t unix,datetime_t* datetime);
|
||||
time_t datetime2unix(datetime_t *datetime);
|
||||
|
||||
void unixtime_set(uint32_t _unixtime);
|
||||
uint32_t unixtime(void);
|
||||
|
||||
uint32_t seconds_from_midnight(datetime_t *datetime);
|
||||
|
||||
static inline int daysfromyearstart(int month){
|
||||
switch (month){
|
||||
case 0:
|
||||
return 0;
|
||||
case 1:
|
||||
return 31;
|
||||
case 2:
|
||||
return 59;
|
||||
case 3:
|
||||
return 90;
|
||||
case 4:
|
||||
return 120;
|
||||
case 5:
|
||||
return 151;
|
||||
case 6:
|
||||
return 181;
|
||||
case 7:
|
||||
return 212;
|
||||
case 8:
|
||||
return 243;
|
||||
case 9:
|
||||
return 273;
|
||||
case 10:
|
||||
return 304;
|
||||
case 11:
|
||||
return 334;
|
||||
default:
|
||||
return 0;
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/threads.h>
|
||||
#include <util/list.h>
|
||||
|
||||
|
||||
extern list_t sys_timers;
|
||||
|
||||
#define TF_REPEAT (1<<0)
|
||||
|
||||
|
||||
struct sys_timer {
|
||||
list_t list;
|
||||
|
||||
uint32_t id;
|
||||
systick_t timeout;
|
||||
systick_t elapse;
|
||||
|
||||
void (*handler)(void);
|
||||
|
||||
union {
|
||||
uint8_t flags;
|
||||
struct {
|
||||
uint8_t repeat:1;
|
||||
uint8_t res:7;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
typedef struct sys_timer SYSTIMER;
|
||||
#define SYSTIMER(ptr) ((SYSTIMER*)ptr)
|
||||
|
||||
|
||||
SYSTIMER* timer_create(uint32_t id,uint32_t timeout);
|
||||
SYSTIMER* timer_create_ex(uint32_t id,uint32_t timeout,void (*handler)(void),uint8_t flags);
|
||||
|
||||
|
||||
void timer_start(SYSTIMER* timer,uint32_t timeout);
|
||||
void timer_cancel(SYSTIMER* timer);
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
uint8_t __trace_get(void) __attribute__((weak));
|
||||
void __trace_set(uint8_t state) __attribute__((weak));
|
||||
|
||||
static inline uint8_t trace_get(void) {
|
||||
if (__trace_get)
|
||||
return __trace_get();
|
||||
return 0;
|
||||
};
|
||||
|
||||
static inline void trace_set(uint8_t state){
|
||||
if (__trace_set)
|
||||
__trace_set(state);
|
||||
};
|
||||
|
||||
static inline void trace_on(uint8_t no) {
|
||||
uint8_t s = trace_get();
|
||||
s |= (1<<no);
|
||||
trace_set(s);
|
||||
};
|
||||
|
||||
static inline void trace_off(uint8_t no) {
|
||||
uint8_t s = trace_get();
|
||||
s &= ~(1<<no);
|
||||
trace_set(s);
|
||||
};
|
||||
|
||||
static inline void trace_swap(uint8_t no) {
|
||||
uint8_t s = trace_get();
|
||||
s ^= (1<<no);
|
||||
trace_set(s);
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int32_t APICALL;
|
||||
|
||||
typedef struct {
|
||||
int32_t seconds;
|
||||
int32_t cycles;
|
||||
} sched_time_t;
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
#pragma once
|
||||
|
||||
/*
|
||||
* unierror.h
|
||||
*
|
||||
* Universelle sprechende Fehlercodes
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
#include <stdint.h>
|
||||
|
||||
/* Definition des 32Bit Fehlermodell */
|
||||
union _ue_code {
|
||||
int32_t code32;
|
||||
struct {
|
||||
union {
|
||||
uint16_t code16;
|
||||
struct {
|
||||
uint32_t code15:15; // Fehlercode
|
||||
uint32_t knowncode:1; // 1=Definierter Standardfehlercode, 0=Benutzerdefinierter Fehlercode
|
||||
};
|
||||
};
|
||||
uint32_t locator:9; // Lokalisation der Ursache
|
||||
uint32_t location:3; // Art der Lokalisationsangabe
|
||||
|
||||
uint32_t family:4; // Error Family
|
||||
};
|
||||
};
|
||||
typedef union _ue_code UECODE;
|
||||
|
||||
#define UNIERROR(fam,loc,loc2,k,c15) ((UECODE){family: fam, location: loc, locator: loc2, knowncode: k, code15: c15})
|
||||
|
||||
|
||||
/* Fehlerfamilien */
|
||||
#define UEF_NONE 0x00 // Keine bekannte Familie
|
||||
#define UEF_ELECTRICAL 0x01 // Elektrischer Fehler
|
||||
#define UEF_MECHANICAL 0x02 // Mechanischer Fehler
|
||||
#define UEF_LOGICAL 0x03 // Logischer Fehler
|
||||
#define UEF_SOFTWARE 0x04 // Software Fehler (z.B. Prüfsummenfehler, Crash, etc.)
|
||||
#define UEF_API 0x05 // API Fehlercode (E...)
|
||||
|
||||
#define UEF_WARNING 0x08 // Fehler ist nicht Fatal, Fehler beschreibt eine Warnung, Es wurde keine Fehlerreaktion ausgeführt
|
||||
|
||||
/* Fehler Locationcodes */
|
||||
#define UEL_UNKNOWN 0x00 // unbekannter Auslöser
|
||||
#define UEL_INTERNAL 0x01 // der Fehler wurde in Software ausgelöst (z.B. Exception, Prüfsummencheck)
|
||||
#define UEL_ASSEMBLY 0x02 // der Fehler wurde durch eine Komponente innerhalb der Baugruppe/Elektronik ausgelöst
|
||||
#define UEL_EXTERNAL 0x03 // der Fehler wurde von Aussen ausgelöst (Sensor, Signal)
|
||||
|
||||
/* Fehlercodes der Familie UEF_ELECTRICAL */
|
||||
#define UE_SHORT_GROUND 0x0001 // Kurzschluss nach Masse
|
||||
#define UE_SHORT_VPLUS 0x0002 // Kurzschluss zu V+
|
||||
|
||||
#define UE_LIMIT_LOW 0x0010 // Grenzwertunterschreitung nach "unten"
|
||||
#define UE_LIMIT_HIGH 0x0011 // Grenzwertüberschreitung nach "oben"
|
||||
|
||||
/* Fehlercodes der Familie UEF_MECHANICAL */
|
||||
#define UE_BLOCKED 0x0001 // Bewegliches Teil ist mechanisch blockiert
|
||||
#define UE_FRICTION 0x0002 // Erhöhter (Reibungs-)widerstand wurde festgestellt
|
||||
|
||||
#define UE_CONNECTION_LOST 0x0010 // Mechanische Verbindung ist gelöst
|
||||
#define UE_BODY_OPEN 0x0011 // Gehäuse ist offen / nicht betriebsicher geschlossen
|
||||
|
||||
/* Fehlercodes der Familie UEF_LOGICAL */
|
||||
#define UE_TIMEOUT 0x0001 // Maximale Wartezeit wurde überschritten
|
||||
#define UE_PLAUSIBILITY 0x0002 // Signale / Eingabewerte sind nicht plausibel bzw. sind widersprüchlich
|
||||
|
||||
/* Fehlercodes der Familie UEF_SOFTWARE */
|
||||
#define UE_CHECKSUM 0x0001 // Prüfsummenfehler
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/errno.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct {
|
||||
uint8_t set,
|
||||
get;
|
||||
|
||||
uint8_t b[32];
|
||||
} fifo32_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t set,
|
||||
get;
|
||||
|
||||
uint8_t b[64];
|
||||
} fifo64_t;
|
||||
|
||||
/**
|
||||
* @brief 32byte FIFOs
|
||||
* @param fifo
|
||||
* @return
|
||||
*/
|
||||
static inline int f32_reset(fifo32_t *fifo){
|
||||
memset( fifo, 0x00, sizeof(fifo32_t) );
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
static inline int f32_read(fifo32_t *fifo){
|
||||
int r;
|
||||
|
||||
if (fifo->get == fifo->set){
|
||||
return -ENOFILE;
|
||||
};
|
||||
|
||||
r = fifo->b[fifo->get];
|
||||
|
||||
fifo->get ++;
|
||||
fifo->get &= 0x1F;
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
static inline int f32_write(fifo32_t *fifo,int ch){
|
||||
|
||||
if ( ((fifo->set + 1) & 0x1F) == fifo->get ){
|
||||
return -ENOFILE;
|
||||
};
|
||||
|
||||
fifo->b[fifo->set] = (uint8_t)(ch & 0xFF);
|
||||
|
||||
fifo->set++;
|
||||
fifo->set &= 0x1F;
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 64 Byte FIFOs
|
||||
* @param fifo
|
||||
* @return
|
||||
*/
|
||||
static inline int f64_reset(fifo64_t *fifo){
|
||||
memset( fifo, 0x00, sizeof(fifo64_t) );
|
||||
return ESUCCESS;
|
||||
};
|
||||
|
||||
static inline int f64_read(fifo64_t *fifo){
|
||||
int r;
|
||||
|
||||
if (fifo->get == fifo->set){
|
||||
return -ENOFILE;
|
||||
};
|
||||
|
||||
r = fifo->b[fifo->get];
|
||||
|
||||
fifo->get ++;
|
||||
fifo->get &= 0x3F;
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
static inline int f64_write(fifo64_t *fifo,int ch){
|
||||
|
||||
if ( ((fifo->set + 1) & 0x3F) == fifo->get ){
|
||||
return -ENOFILE;
|
||||
};
|
||||
|
||||
fifo->b[fifo->set] = (uint8_t)(ch & 0xFF);
|
||||
|
||||
fifo->set++;
|
||||
fifo->set &= 0x3F;
|
||||
|
||||
return ESUCCESS;
|
||||
};
|
|
@ -0,0 +1,102 @@
|
|||
#pragma once
|
||||
/**
|
||||
* util/list.h
|
||||
*
|
||||
* Double Linked Lists for C
|
||||
*
|
||||
* (c) 2016 Harald Christian Joachim Wolff
|
||||
*
|
||||
* API (may be implemented with macros!) :
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct _list {
|
||||
struct _list *next,
|
||||
*prev;
|
||||
} list_t;
|
||||
|
||||
#define LIST_INIT_STATIC(name) { &(name), &(name) }
|
||||
|
||||
#define LIST(name) list_t name = LIST_INIT_STATIC(name)
|
||||
|
||||
static inline void __list_init(list_t *list){
|
||||
list->next = list->prev = list;
|
||||
}
|
||||
|
||||
#define list_init(L) __list_init(L);
|
||||
|
||||
static inline void __list_add(list_t *item,list_t *prev,list_t *next) {
|
||||
prev->next = item;
|
||||
next->prev = item;
|
||||
item->next = next;
|
||||
item->prev = prev;
|
||||
};
|
||||
|
||||
static inline void list_remove(list_t *item){
|
||||
item->prev->next = item->next;
|
||||
item->next->prev = item->prev;
|
||||
item->prev = item->next = item;
|
||||
};
|
||||
|
||||
static inline void list_append(list_t* item,list_t* head){
|
||||
__list_add(item,head->prev,head);
|
||||
};
|
||||
|
||||
static inline void list_insert(list_t* item,list_t* head){
|
||||
__list_add(item,head,head->next);
|
||||
};
|
||||
|
||||
static inline list_t* list_next(list_t* item){ return item->next; };
|
||||
static inline list_t* list_prev(list_t* item){ return item->prev; };
|
||||
|
||||
static inline int list_is_empty(list_t *list) {
|
||||
return (list->next == list);
|
||||
};
|
||||
|
||||
static inline list_t* list_get(list_t *head,int n){
|
||||
if (list_is_empty(head)){
|
||||
return 0L;
|
||||
};
|
||||
while (n--){
|
||||
head = head->next;
|
||||
};
|
||||
return head;
|
||||
};
|
||||
static inline list_t* list_fetch_first(list_t *head){
|
||||
if (!list_is_empty(head)){
|
||||
list_t *f = head->next;
|
||||
list_remove(f);
|
||||
return f;
|
||||
} else {
|
||||
return 0L;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* list_entry - get container struct of entry
|
||||
* @P: Pointer to entry
|
||||
* @T: Type of struct
|
||||
* @M: entry member of struct
|
||||
*/
|
||||
#define list_entry(P,T,M) ((T*)(int)(((int)(P)) - (int)(&(((T*)0L)->M))))
|
||||
|
||||
#define list_next_entry(P,T,M) list_entry((P)->next,T,M)
|
||||
#define list_prev_entry(P,T,M) list_entry((P)->prev,T,M)
|
||||
|
||||
#define list_first_entry(P,T,M) ((P)->next != (P) ? list_entry((P)->next,T,M) : NULL)
|
||||
#define list_last_entry(P,T,M) ((P)->prev != (P) ? list_entry((P)->prev,T,M) : NULL)
|
||||
|
||||
#define for_each_list_entry(pos,list) for (pos = (list)->next; pos != (list); pos = pos->next)
|
||||
#define for_each_list_entry_reverse(pos,list) for (pos = (list)->prev; pos != (list); pos = pos->prev)
|
||||
|
||||
#define for_each_list_entry_save(pos,tmp,list) for (pos = (list)->next, tmp = pos->next; pos != (list); pos = tmp, tmp = pos->next)
|
||||
|
||||
static inline int list_count(list_t *head){
|
||||
list_t *t;
|
||||
int n = 0;
|
||||
for_each_list_entry(t,head){
|
||||
n++;
|
||||
};
|
||||
return n;
|
||||
};
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/atomic.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
uint16_t size;
|
||||
uint16_t pos;
|
||||
uint8_t *buffer;
|
||||
} buffer_t;
|
||||
|
||||
static inline int buffer_set(buffer_t *buffer,void *mem,int size){
|
||||
if (buffer){
|
||||
ATOMIC
|
||||
|
||||
buffer->buffer = mem;
|
||||
buffer->pos = 0;
|
||||
buffer->size = size;
|
||||
return ESUCCESS;
|
||||
};
|
||||
return -ENULLPTR;
|
||||
};
|
||||
|
||||
static inline int buffer_pos(buffer_t *buffer){
|
||||
ATOMIC
|
||||
|
||||
return (buffer) ? buffer->pos : -ENULLPTR;
|
||||
};
|
||||
|
||||
static inline int buffer_free(buffer_t *buffer){
|
||||
ATOMIC
|
||||
|
||||
return (buffer) ? (buffer->size - buffer->pos) : -ENULLPTR;
|
||||
};
|
||||
|
||||
#define buffer_byte(b) ((b)->buffer[(b)->pos++])
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/.build/access_authorize.o: \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/src/access_authorize.c \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/access.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/bits.h
|
|
@ -0,0 +1,38 @@
|
|||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/.build/adc_avr.o: \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/src/adc_avr.c \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/adc.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/regbus.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/telegram.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/chksum.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/stack.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/cpu/atmega1284p/include/cpu/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/cpu/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/dbg.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdlib.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/types.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/list.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/register.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/link.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdio.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/io/usart.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/util.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/errno.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/fifo.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/proxy.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/instance.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/spinlock.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/spinlock.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/trace.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/api.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/serial.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/fifo.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/mutex.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/eeprom.h
|
|
@ -0,0 +1,39 @@
|
|||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/.build/adc_cpu.o: \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/src/adc_cpu.c \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/adc.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/regbus.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/telegram.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/chksum.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/stack.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/cpu/atmega1284p/include/cpu/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/cpu/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/dbg.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdlib.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/types.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/list.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/register.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/link.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdio.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/io/usart.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/util.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/errno.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/fifo.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/proxy.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/instance.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/spinlock.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/spinlock.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/trace.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/api.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/serial.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/fifo.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/mutex.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/eeprom.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/bits.h
|
|
@ -0,0 +1,44 @@
|
|||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/.build/adc_register_proc.o: \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/src/adc_register_proc.c \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/adc.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/regbus.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/telegram.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/chksum.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/stack.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/cpu/atmega1284p/include/cpu/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/cpu/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/dbg.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdlib.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/types.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/list.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/register.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/link.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdio.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/io/usart.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/util.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/errno.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/fifo.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/proxy.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/instance.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/spinlock.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/spinlock.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/trace.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/api.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/serial.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/fifo.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/mutex.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/eeprom.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/runtime.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/runtime.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/timer.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/time.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/fixpoint/fp4816.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/fixpoint/ieee.h
|
|
@ -0,0 +1,42 @@
|
|||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/.build/assert.o: \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/src/assert.c \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/assert.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/utils.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/stack.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/cpu/atmega1284p/include/cpu/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/cpu/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/dbg.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdlib.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/types.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/list.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/runtime.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/eeprom.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/chksum.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/mutex.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/regbus.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/telegram.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/register.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/link.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdio.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/io/usart.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/util.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/errno.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/fifo.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/proxy.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/instance.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/spinlock.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/spinlock.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/trace.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/rb2/api.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/serial.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/fifo.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/timer.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/time.h
|
|
@ -0,0 +1,19 @@
|
|||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/.build/bootloader.o: \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/src/bootloader.c \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdio.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdlib.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/stack.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/cpu/atmega1284p/include/cpu/systick.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/arch/atomic.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/cpu/cpu.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/dbg.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/types.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/util/list.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/threads.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/sys/bootloader.h
|
|
@ -0,0 +1,4 @@
|
|||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/.build/chksum.o: \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/src/chksum.c \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/hwo/chksum.h \
|
||||
/Volumes/HOMES/haraldwolff/src/hf3/avr-fw-sxm/avrmaker/modules/avr/core/include/stdlib.h
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue