-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathjsd_el2798_pub.h
56 lines (48 loc) · 1.41 KB
/
jsd_el2798_pub.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef JSD_EL2798_PUB_H
#define JSD_EL2798_PUB_H
#ifdef __cplusplus
extern "C" {
#endif
#include "jsd/jsd_el2798_types.h"
#include "jsd/jsd_pub.h"
/**
* @brief Read the EL2798 State
*
* Note: this device does not actually provide PDO feedback on state,
* This function reads back the cmd sent to the EL2798 device
*
* @param self pointer to JSD context
* @param slave_id id of EL2798 device
* @return Pointer to EL2798 device state
*/
const jsd_el2798_state_t* jsd_el2798_get_state(jsd_t* self, uint16_t slave_id);
/**
* @brief process loop required for proper device function
*
* @param self pointer to JSD context
* @param slave_id id of EL2798 device
*/
void jsd_el2798_process(jsd_t* self, uint16_t slave_id);
/**
* @brief Sets a specified channel level
*
* @param self pointer to JSD context
* @param slave_id id of EL2798 device
* @param channel specified device channel to command
* @param output command level (0 or 1)
*/
void jsd_el2798_write_single_channel(jsd_t* self, uint16_t slave_id,
uint8_t channel, uint8_t output);
/**
* @brief Sets all channel levels
*
* @param self pointer to JSD context
* @param slave_id id of EL2798 device
* @param output command level (0 or 1)
*/
void jsd_el2798_write_all_channels(jsd_t* self, uint16_t slave_id,
uint8_t output[JSD_EL2798_NUM_CHANNELS]);
#ifdef __cplusplus
}
#endif
#endif