no-OS
max14919.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef _MAX14919_H
34 #define _MAX14919_H
35 
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include "no_os_gpio.h"
39 #include "no_os_util.h"
40 #include "no_os_error.h"
41 
42 #define MAX14919_OUT_CHANNELS 4
43 
47 };
48 
54 };
55 
64 };
65 
69 struct max14919_desc {
75 };
76 
78 int max14919_set_out(struct max14919_desc *desc,
79  enum max14919_out_state *state);
80 
82 int max14919_set_climit(struct max14919_desc *desc, bool state);
83 
85 int max14919_get_fault(struct max14919_desc *desc, uint8_t* fault);
86 
88 int max14919_detect_rev(struct max14919_desc *desc, uint8_t* rev);
89 
91 int max14919_init(struct max14919_desc **desc,
93 
95 int max14919_remove(struct max14919_desc *desc);
96 
97 #endif /* _MAX14919_H */
MAX14919_OUT_OFF
@ MAX14919_OUT_OFF
Definition: max14919.h:45
max14919_init
int max14919_init(struct max14919_desc **desc, struct max14919_init_param *init_param)
Initialize the MAX14919 device descriptor.
Definition: max14919.c:125
MAX14919_OUT2
@ MAX14919_OUT2
Definition: max14919.h:51
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
max14919_init_param::in_param
struct no_os_gpio_init_param * in_param[MAX14919_OUT_CHANNELS]
Definition: max14919.h:60
max14919_desc::fault_desc
struct no_os_gpio_desc * fault_desc
Definition: max14919.h:72
MAX14919_OUT_CHANNELS
#define MAX14919_OUT_CHANNELS
Definition: max14919.h:42
max14919_get_fault
int max14919_get_fault(struct max14919_desc *desc, uint8_t *fault)
Get the FAULT state of the device.
Definition: max14919.c:91
max14919_remove
int max14919_remove(struct max14919_desc *desc)
Free resources allocated by the init function.
Definition: max14919.c:191
max14919_init_param::inrush_param
struct no_os_gpio_init_param * inrush_param
Definition: max14919.h:61
max14919_desc
Structure holding te MAX14919 device descriptor.
Definition: max14919.h:69
MAX14919_OUT1
@ MAX14919_OUT1
Definition: max14919.h:50
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:221
MAX14919_OUT_ON
@ MAX14919_OUT_ON
Definition: max14919.h:46
max14919_desc::in_desc
struct no_os_gpio_desc * in_desc[MAX14919_OUT_CHANNELS]
Definition: max14919.h:70
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
max14919_out_state
max14919_out_state
Definition: max14919.h:44
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:54
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:124
max14919_init_param::rev_param
struct no_os_gpio_init_param * rev_param
Definition: max14919.h:63
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
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:125
max14919_desc::rev_desc
struct no_os_gpio_desc * rev_desc
Definition: max14919.h:73
max14919_detect_rev
int max14919_detect_rev(struct max14919_desc *desc, uint8_t *rev)
Detect reverse polarity of the current.
Definition: max14919.c:108
MAX14919_OUT3
@ MAX14919_OUT3
Definition: max14919.h:52
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:104
max14919_out_chan
max14919_out_chan
Definition: max14919.h:49
max14919_detect_rev
int max14919_detect_rev(struct max14919_desc *desc, uint8_t *rev)
Detect reverse polarity of the current.
Definition: max14919.c:108
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
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:49
max14919_desc::inrush_desc
struct no_os_gpio_desc * inrush_desc
Definition: max14919.h:71
max14919_set_climit
int max14919_set_climit(struct max14919_desc *desc, bool state)
Set current limiting.
Definition: max14919.c:73
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:69
max14919_set_climit
int max14919_set_climit(struct max14919_desc *desc, bool state)
Set current limiting.
Definition: max14919.c:73
max14919_init_param
Structure holding the MAX14919 initialization parameter.
Definition: max14919.h:59
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:197
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
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:74
max14919_set_out
int max14919_set_out(struct max14919_desc *desc, enum max14919_out_state *state)
Set the OUT channels state.
Definition: max14919.c:43
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:91
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:147
max14919_init_param::fault_param
struct no_os_gpio_init_param * fault_param
Definition: max14919.h:62
MAX14919_OUT4
@ MAX14919_OUT4
Definition: max14919.h:53
max14919_remove
int max14919_remove(struct max14919_desc *desc)
Free resources allocated by the init function.
Definition: max14919.c:191
max14919_set_out
int max14919_set_out(struct max14919_desc *desc, enum max14919_out_state *state)
Set the OUT channels state.
Definition: max14919.c:43
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:75