no-OS
max14919.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef _MAX14919_H
40 #define _MAX14919_H
41 
42 #include <stdint.h>
43 #include <stdbool.h>
44 #include "no_os_gpio.h"
45 #include "no_os_util.h"
46 #include "no_os_error.h"
47 
48 #define MAX14919_OUT_CHANNELS 4
49 
53 };
54 
60 };
61 
70 };
71 
75 struct max14919_desc {
81 };
82 
84 int max14919_set_out(struct max14919_desc *desc,
85  enum max14919_out_state *state);
86 
88 int max14919_set_climit(struct max14919_desc *desc, bool state);
89 
91 int max14919_get_fault(struct max14919_desc *desc, uint8_t* fault);
92 
94 int max14919_detect_rev(struct max14919_desc *desc, uint8_t* rev);
95 
97 int max14919_init(struct max14919_desc **desc,
99 
101 int max14919_remove(struct max14919_desc *desc);
102 
103 #endif /* _MAX14919_H */
MAX14919_OUT_OFF
@ MAX14919_OUT_OFF
Definition: max14919.h:51
max14919_init
int max14919_init(struct max14919_desc **desc, struct max14919_init_param *init_param)
Initialize the MAX14919 device descriptor.
Definition: max14919.c:131
MAX14919_OUT2
@ MAX14919_OUT2
Definition: max14919.h:57
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
max14919_init_param::in_param
struct no_os_gpio_init_param * in_param[MAX14919_OUT_CHANNELS]
Definition: max14919.h:66
max14919_desc::fault_desc
struct no_os_gpio_desc * fault_desc
Definition: max14919.h:78
MAX14919_OUT_CHANNELS
#define MAX14919_OUT_CHANNELS
Definition: max14919.h:48
max14919_get_fault
int max14919_get_fault(struct max14919_desc *desc, uint8_t *fault)
Get the FAULT state of the device.
Definition: max14919.c:97
max14919_remove
int max14919_remove(struct max14919_desc *desc)
Free resources allocated by the init function.
Definition: max14919.c:197
max14919_init_param::inrush_param
struct no_os_gpio_init_param * inrush_param
Definition: max14919.h:67
max14919_desc
Structure holding te MAX14919 device descriptor.
Definition: max14919.h:75
MAX14919_OUT1
@ MAX14919_OUT1
Definition: max14919.h:56
no_os_gpio_get_value
int32_t no_os_gpio_get_value(struct no_os_gpio_desc *desc, uint8_t *value)
Get the value of the specified GPIO.
Definition: no_os_gpio.c:227
MAX14919_OUT_ON
@ MAX14919_OUT_ON
Definition: max14919.h:52
max14919_desc::in_desc
struct no_os_gpio_desc * in_desc[MAX14919_OUT_CHANNELS]
Definition: max14919.h:76
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
max14919_out_state
max14919_out_state
Definition: max14919.h:50
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
no_os_gpio_direction_input
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:130
max14919_init_param::rev_param
struct no_os_gpio_init_param * rev_param
Definition: max14919.h:69
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
no_os_error.h
Error codes definition.
max14919_init
int max14919_init(struct max14919_desc **desc, struct max14919_init_param *init_param)
Initialize the MAX14919 device descriptor.
Definition: max14919.c:131
max14919_desc::rev_desc
struct no_os_gpio_desc * rev_desc
Definition: max14919.h:79
max14919_detect_rev
int max14919_detect_rev(struct max14919_desc *desc, uint8_t *rev)
Detect reverse polarity of the current.
Definition: max14919.c:114
MAX14919_OUT3
@ MAX14919_OUT3
Definition: max14919.h:58
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:110
max14919_out_chan
max14919_out_chan
Definition: max14919.h:55
max14919_detect_rev
int max14919_detect_rev(struct max14919_desc *desc, uint8_t *rev)
Detect reverse polarity of the current.
Definition: max14919.c:114
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
no_os_gpio_get
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:55
max14919_desc::inrush_desc
struct no_os_gpio_desc * inrush_desc
Definition: max14919.h:77
max14919_set_climit
int max14919_set_climit(struct max14919_desc *desc, bool state)
Set current limiting.
Definition: max14919.c:79
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:75
max14919_set_climit
int max14919_set_climit(struct max14919_desc *desc, bool state)
Set current limiting.
Definition: max14919.c:79
max14919_init_param
Structure holding the MAX14919 initialization parameter.
Definition: max14919.h:65
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:203
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
no_os_gpio.h
Header file of GPIO Interface.
max14919_desc::out_state
enum max14919_out_state out_state[MAX14919_OUT_CHANNELS]
Definition: max14919.h:80
max14919_set_out
int max14919_set_out(struct max14919_desc *desc, enum max14919_out_state *state)
Set the OUT channels state.
Definition: max14919.c:49
max14919.h
Header file of MAX14919 Driver.
max14919_get_fault
int max14919_get_fault(struct max14919_desc *desc, uint8_t *fault)
Get the FAULT state of the device.
Definition: max14919.c:97
no_os_util.h
Header file of utility functions.
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:153
max14919_init_param::fault_param
struct no_os_gpio_init_param * fault_param
Definition: max14919.h:68
MAX14919_OUT4
@ MAX14919_OUT4
Definition: max14919.h:59
max14919_remove
int max14919_remove(struct max14919_desc *desc)
Free resources allocated by the init function.
Definition: max14919.c:197
max14919_set_out
int max14919_set_out(struct max14919_desc *desc, enum max14919_out_state *state)
Set the OUT channels state.
Definition: max14919.c:49
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:81