failed approach
This commit is contained in:
48
gomspace/libp60_client/include/p60.h
Normal file
48
gomspace/libp60_client/include/p60.h
Normal file
@ -0,0 +1,48 @@
|
||||
#ifndef _P60_H_
|
||||
#define _P60_H_
|
||||
/* Copyright (c) 2013-2018 GomSpace A/S. All rights reserved. */
|
||||
|
||||
#define P60_PORT_RPARAM 7
|
||||
#define P60_PORT_GNDWDT_RESET 9
|
||||
#define P60_PORT_CMDCONTROL 10
|
||||
#define P60_PORT_GSSB_SERVICE 15
|
||||
#define P60_PORT_GSCRIPT 22
|
||||
|
||||
/** FRAM MEMORY MAP */
|
||||
#define P60_FRAM_BOARD 0x0000
|
||||
|
||||
/** FRAM FILENAMES */
|
||||
#define P60_FNO_BOARD 0
|
||||
#define P60_FNO_BOARD_DFL 4
|
||||
|
||||
#define P60_FRAM_WP_BEGIN (0x1000)
|
||||
#define P60_FRAM_WP_END (0x1C00 - 1)
|
||||
|
||||
/** GND WD FRAM ADDR **/
|
||||
#define P60_FRAM_GNDWDT 0x1F00
|
||||
|
||||
/** PARAM INDEX MAP */
|
||||
#define P60_BOARD_PARAM 0
|
||||
|
||||
#define DEVICE_FM24CL64B 0
|
||||
|
||||
typedef enum {
|
||||
UNKNOWN_RST = 0,
|
||||
GND_WDT_RST,
|
||||
I2C_WDT_RST,
|
||||
CAN_WDT_RST,
|
||||
EXT_HARD_RST,
|
||||
EXT_SOFT_RST,
|
||||
} p60_reset_cause_t;
|
||||
|
||||
extern const uint8_t board_fallback_type;
|
||||
extern const uint8_t csp_fallback_addr;
|
||||
extern const uint8_t board_rs422_mode;
|
||||
|
||||
extern void module_init_early(void);
|
||||
extern void module_init(void);
|
||||
extern void wdt_gnd_clear(void);
|
||||
extern uint16_t command_control(uint8_t *packet, uint16_t length);
|
||||
extern void module_task(void * pvParameters);
|
||||
|
||||
#endif /* _P60_H_ */
|
35
gomspace/libp60_client/include/p60_board.h
Normal file
35
gomspace/libp60_client/include/p60_board.h
Normal file
@ -0,0 +1,35 @@
|
||||
/* Copyright (c) 2013-2018 GomSpace A/S. All rights reserved. */
|
||||
/**
|
||||
* NanoCom firmware
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef P60_PARAM_H_
|
||||
#define P60_PARAM_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <param/param_types.h>
|
||||
|
||||
/**
|
||||
* Define memory space
|
||||
*/
|
||||
#define P60_BOARD_UID 0x00
|
||||
#define P60_BOARD_TYPE 0x10
|
||||
#define P60_BOARD_REV 0x11
|
||||
#define P60_BOARD_CSP_ADDR 0x12
|
||||
#define P60_BOARD_I2C_ADDR 0x13
|
||||
#define P60_BOARD_I2C_SPEED_KHZ 0x14
|
||||
#define P60_BOARD_CAN_SPEED_KHZ 0x16
|
||||
#define P60_BOARD_KISS_ENABLE 0x18
|
||||
#define P60_BOARD_RS422_MODE 0x19
|
||||
#define P60_BOARD_RS422_SPEED_KHZ 0x1C
|
||||
#define P60_BOARD_RTABLE_STR 0x20 //! This one is 0x60 = 96 bytes
|
||||
#define P60_BOARD_RTABLE_STR_SIZE 0x60
|
||||
|
||||
/** Define the memory size */
|
||||
#define P60_BOARD_PARAM_SIZE 0x80
|
||||
|
||||
extern const param_table_t p60_config[];
|
||||
extern const int p60_config_count;
|
||||
|
||||
#endif /* P60_PARAM_H_ */
|
62
gomspace/libp60_client/include/power_if.h
Normal file
62
gomspace/libp60_client/include/power_if.h
Normal file
@ -0,0 +1,62 @@
|
||||
/* Copyright (c) 2013-2018 GomSpace A/S. All rights reserved. */
|
||||
/**
|
||||
* NanoPower firmware
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef POWER_IF_H_
|
||||
#define POWER_IF_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define POWER_IF_SET 1
|
||||
#define POWER_IF_GET 2
|
||||
#define POWER_IF_LIST 3
|
||||
|
||||
#define POWER_IF_STATUS_OK 0
|
||||
#define POWER_IF_STATUS_ERROR 1
|
||||
|
||||
#define POWER_IF_NAME_LEN 8
|
||||
|
||||
typedef struct __attribute__((packed)) {
|
||||
uint8_t ch_idx;
|
||||
uint8_t mode;
|
||||
uint16_t on_cnt;
|
||||
uint16_t off_cnt;
|
||||
uint16_t cur_lu_lim;
|
||||
uint16_t cur_lim;
|
||||
uint16_t voltage;
|
||||
int16_t current;
|
||||
uint16_t latchup;
|
||||
char name[POWER_IF_NAME_LEN];
|
||||
} power_if_ch_status_t;
|
||||
|
||||
typedef struct __attribute__((packed)) {
|
||||
uint8_t ch_idx;
|
||||
uint8_t mode;
|
||||
char name[8];
|
||||
} power_if_list_t;
|
||||
|
||||
typedef struct __attribute__((packed)) {
|
||||
uint8_t cmd;
|
||||
uint8_t status;
|
||||
power_if_ch_status_t ch_status;
|
||||
} power_if_cmd_request_t;
|
||||
|
||||
typedef struct __attribute__((packed)) {
|
||||
uint8_t cmd;
|
||||
uint8_t status;
|
||||
power_if_ch_status_t ch_status;
|
||||
} power_if_cmd_response_t;
|
||||
|
||||
typedef struct __attribute__((packed)) {
|
||||
uint8_t cmd;
|
||||
uint8_t status;
|
||||
uint8_t count;
|
||||
power_if_list_t list[16];
|
||||
} power_if_cmd_list_response_t;
|
||||
|
||||
int p60_power_if_cmd(uint8_t node, uint8_t port, uint32_t timeout, uint8_t cmd, void * ch_status_p);
|
||||
uint8_t p60_power_if_get_ch_idx(char * ch_name, uint8_t * ch_no, uint8_t ch_no_max);
|
||||
|
||||
#endif /* POWER_IF_H_ */
|
Reference in New Issue
Block a user