issue with makefile

This commit is contained in:
2020-12-20 13:31:44 +01:00
parent a9f2c98f8d
commit 23fd408e08
507 changed files with 585 additions and 66403 deletions

View File

@ -0,0 +1,76 @@
/*
Cubesat Space Protocol - A small network-layer protocol designed for Cubesats
Copyright (C) 2012 GomSpace ApS (http://www.gomspace.com)
Copyright (C) 2012 AAUSAT3 Project (http://aausat3.space.aau.dk)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CSP_IF_CAN_H_
#define _CSP_IF_CAN_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <csp/csp.h>
#include <csp/csp_interface.h>
/* CAN header macros */
#define CFP_HOST_SIZE 5
#define CFP_TYPE_SIZE 1
#define CFP_REMAIN_SIZE 8
#define CFP_ID_SIZE 10
/* Macros for extracting header fields */
#define CFP_FIELD(id,rsiz,fsiz) ((uint32_t)((uint32_t)((id) >> (rsiz)) & (uint32_t)((1 << (fsiz)) - 1)))
#define CFP_SRC(id) CFP_FIELD(id, CFP_HOST_SIZE + CFP_TYPE_SIZE + CFP_REMAIN_SIZE + CFP_ID_SIZE, CFP_HOST_SIZE)
#define CFP_DST(id) CFP_FIELD(id, CFP_TYPE_SIZE + CFP_REMAIN_SIZE + CFP_ID_SIZE, CFP_HOST_SIZE)
#define CFP_TYPE(id) CFP_FIELD(id, CFP_REMAIN_SIZE + CFP_ID_SIZE, CFP_TYPE_SIZE)
#define CFP_REMAIN(id) CFP_FIELD(id, CFP_ID_SIZE, CFP_REMAIN_SIZE)
#define CFP_ID(id) CFP_FIELD(id, 0, CFP_ID_SIZE)
/* Macros for building CFP headers */
#define CFP_MAKE_FIELD(id,fsiz,rsiz) ((uint32_t)(((id) & (uint32_t)((uint32_t)(1 << (fsiz)) - 1)) << (rsiz)))
#define CFP_MAKE_SRC(id) CFP_MAKE_FIELD(id, CFP_HOST_SIZE, CFP_HOST_SIZE + CFP_TYPE_SIZE + CFP_REMAIN_SIZE + CFP_ID_SIZE)
#define CFP_MAKE_DST(id) CFP_MAKE_FIELD(id, CFP_HOST_SIZE, CFP_TYPE_SIZE + CFP_REMAIN_SIZE + CFP_ID_SIZE)
#define CFP_MAKE_TYPE(id) CFP_MAKE_FIELD(id, CFP_TYPE_SIZE, CFP_REMAIN_SIZE + CFP_ID_SIZE)
#define CFP_MAKE_REMAIN(id) CFP_MAKE_FIELD(id, CFP_REMAIN_SIZE, CFP_ID_SIZE)
#define CFP_MAKE_ID(id) CFP_MAKE_FIELD(id, CFP_ID_SIZE, 0)
/* Mask to uniquely separate connections */
#define CFP_ID_CONN_MASK (CFP_MAKE_SRC((uint32_t)(1 << CFP_HOST_SIZE) - 1) | \
CFP_MAKE_DST((uint32_t)(1 << CFP_HOST_SIZE) - 1) | \
CFP_MAKE_ID((uint32_t)(1 << CFP_ID_SIZE) - 1))
/**
Default Maximum Transmission Unit (MTU) for CSP over CAN.
Maximum value is 2042 bytes.
*/
#define CSP_CAN_MTU 256
int csp_can_rx(csp_iface_t *interface, uint32_t id, const uint8_t * data, uint8_t dlc, CSP_BASE_TYPE *task_woken);
int csp_can_tx(csp_iface_t *interface, csp_packet_t *packet, uint32_t timeout);
/* Must be implemented by the driver */
int csp_can_tx_frame(csp_iface_t *interface, uint32_t id, const uint8_t * data, uint8_t dlc);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _CSP_IF_CAN_H_ */

View File

@ -0,0 +1,51 @@
/*
Cubesat Space Protocol - A small network-layer protocol designed for Cubesats
Copyright (C) 2012 GomSpace ApS (http://www.gomspace.com)
Copyright (C) 2012 AAUSAT3 Project (http://aausat3.space.aau.dk)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CSP_IF_I2C_H_
#define _CSP_IF_I2C_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <csp/csp.h>
#include <csp/csp_interface.h>
#include <csp/drivers/i2c.h>
extern csp_iface_t csp_if_i2c;
/**
* Capture I2C RX events for CSP
* @param opt_addr local i2c address
* @param handle which i2c device to use
* @param speed interface speed in kHz (normally 100 or 400)
* @return csp_error.h code
*/
int csp_i2c_init(uint8_t opt_addr, int handle, int speed);
void csp_i2c_rx(i2c_frame_t * frame, void * pxTaskWoken);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _CSP_IF_I2C_H_ */

View File

@ -0,0 +1,110 @@
/*
Cubesat Space Protocol - A small network-layer protocol designed for Cubesats
Copyright (C) 2012 GomSpace ApS (http://www.gomspace.com)
Copyright (C) 2012 AAUSAT3 Project (http://aausat3.space.aau.dk)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CSP_IF_KISS_H_
#define _CSP_IF_KISS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <csp/csp.h>
#include <csp/csp_interface.h>
/**
* The KISS interface relies on the USART callback in order to parse incoming
* messaged from the serial interface. The USART callback however does not
* support passing the handle number of the responding USART, so you need to implement
* a USART callback for each handle and then call kiss_rx subsequently.
*
* In order to initialize the KISS interface. Fist call kiss_init() and then
* setup your usart to call csp_kiss_rx when new data is available.
*
* When a byte is not a part of a kiss packet, it will be returned to your
* usart driver using the usart_insert funtion that you provide.
*
* @param csp_iface pointer to interface
* @param buf pointer to incoming data
* @param len length of incoming data
* @param pxTaskWoken NULL if task context, pointer to variable if ISR
*/
void csp_kiss_rx(csp_iface_t * interface, uint8_t *buf, int len, void *pxTaskWoken);
/**
* The putc function is used by the kiss interface to send
* a string of data to the serial port. This function must
* be implemented by the user, and passed to the kiss
* interface through the kiss_init function.
* @param buf byte to push
*/
typedef void (*csp_kiss_putc_f)(char buf);
/**
* The characters not accepted by the kiss interface, are discarded
* using this function, which must be implemented by the user
* and passed through the kiss_init function.
*
* This reject function is typically used to display ASCII strings
* sent over the serial port, which are not in KISS format. Such as
* debugging information.
*
* @param c rejected character
* @param pxTaskWoken NULL if task context, pointer to variable if ISR
*/
typedef void (*csp_kiss_discard_f)(char c, void *pxTaskWoken);
typedef enum {
KISS_MODE_NOT_STARTED,
KISS_MODE_STARTED,
KISS_MODE_ESCAPED,
KISS_MODE_SKIP_FRAME,
} kiss_mode_e;
/**
* This structure should be statically allocated by the user
* and passed to the kiss interface during the init function
* no member information should be changed
*/
typedef struct csp_kiss_handle_s {
//! Put character on usart (tx).
csp_kiss_putc_f kiss_putc;
//! Discard - not KISS data (rx).
csp_kiss_discard_f kiss_discard;
//! Internal KISS state.
unsigned int rx_length;
//! Internal KISS state.
kiss_mode_e rx_mode;
//! Internal KISS state.
unsigned int rx_first;
//! Not used.
volatile unsigned char *rx_cbuf;
//! Internal KISS state.
csp_packet_t * rx_packet;
} csp_kiss_handle_t;
void csp_kiss_init(csp_iface_t * csp_iface, csp_kiss_handle_t * csp_kiss_handle, csp_kiss_putc_f kiss_putc_f, csp_kiss_discard_f kiss_discard_f, const char * name);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _CSP_IF_KISS_H_ */

View File

@ -0,0 +1,38 @@
/*
Cubesat Space Protocol - A small network-layer protocol designed for Cubesats
Copyright (C) 2012 GomSpace ApS (http://www.gomspace.com)
Copyright (C) 2012 AAUSAT3 Project (http://aausat3.space.aau.dk)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CSP_IF_LO_H_
#define _CSP_IF_LO_H_
#ifdef __cplusplus
extern "C" {
#endif
/* CSP includes */
#include <csp/csp.h>
#include <csp/csp_interface.h>
extern csp_iface_t csp_if_lo;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif // _CSP_IF_LO_H_

View File

@ -0,0 +1,26 @@
#ifndef CSP_IF_ZMQHUB_H_
#define CSP_IF_ZMQHUB_H_
#include <csp/csp.h>
extern csp_iface_t csp_if_zmqhub;
/**
* Setup ZMQ interface
* @param addr only receive messages matching this address (255 means all)
* @param host Pointer to string containing zmqproxy host
* @return CSP_ERR
*/
int csp_zmqhub_init(uint8_t addr, const char * host);
/**
* Setup ZMQ interface
* @param addr only receive messages matching this address (255 means all)
* @param publisher_endpoint Pointer to string containing zmqproxy publisher endpoint
* @param subscriber_endpoint Pointer to string containing zmqproxy subscriber endpoint
* @return CSP_ERR
*/
int csp_zmqhub_init_w_endpoints(uint8_t addr, const char * publisher_url,
const char * subscriber_url);
#endif /* CSP_IF_ZMQHUB_H_ */