NanoPower P60 Dock
July 14, 2017
gs-man-nanopower-p60-dock-2.1
if (res > 0) {
printf("Get VCC enable: %u\n", vcc_enable);
}
Set a single configuration parameter on P60 Dock:
#include <p60dock.h>
/
*
Enable X1 VCC
*
/
uint8_t vcc_enable = 1;
int res = rparam_set_single(&vcc_enable, /
*
Pointer to variable
*
/
P60DOCK_OUT_EN(0), /
*
Logical address of parameter
*
/
PARAM_UINT8, /
*
Parameter type
*
/
1, /
*
Parameter size
*
/
P60DOCK_PARAM, /
*
Parameter table id
*
/
p60dock_node, /
*
P60 Dock csp node address
*
/
P60_PORT_RPARAM, /
*
CSP port number
*
/
1000); /
*
Timeout in milliseconds
*
/
if (res > 0) {
printf("Set vcc enable: %u\n", vcc_enable);
}
6.3 Retriving Housekeeping Parameters
Retrieving Housekeeping Parameters from the P60 Dock is provided by the p60dock_get_hk function.
int p60dock_get_hk(param_index_t
*
mem, uint8_t node, uint32_t timeout);
This function is used to retrieve housekeeping parameters from the P60 Dock. The housekeeping param-
eters are retrieved over CSP using the remote parameter system API provided by libparam. The function
p60dock_get_hk is basically a wrapper around the remote parameter system API. The input parameter mem
must be provided with a pointer to memory to hold the housekeeping parameters. The input parameter node
must provide the CSP node address of the P60 Dock and the timeout must provide the timeout in milliseconds.
An example is shown below.
#include <p60dock.h>
uint8_t p60dock_node = 4;
uint8_t hk_mem[P60DOCK_HK_SIZE];
param_index_t p60dock_hk = {0};
p60dock_hk.physaddr = hk_mem;
if (!p60dock_get_hk(&p60dock_hk, p60dock_node, 1000)) {
printf("Error getting p60dock hk\n");
} else {
param_list(&p60dock_hk, 1);
}
Housekeeping parameters can also be retrieved directly from P60 Dock using the remote parameter system API
provided by libparam:
#include <p60dock.h>
uint8_t p60dock_node = 4;
uint8_t out_en;
int res = rparam_get_single(&out_en, /
*
Pointer to variable
*
/
P60DOCK_HK_OUT_EN(0), /
*
Logical address of parameter
*
/
PARAM_UINT8, /
*
Parameter type
*
/
1, /
*
Parameter size
*
/
P60DOCK_HK, /
*
Parameter table id
*
/
p60dock_node, /
*
P60 Dock csp node address
*
/
P60_PORT_RPARAM, /
*
CSP port number
*
/
© 2016 GomSpace Aps
14