no-OS
max14914.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef _MAX14914_H
34 #define _MAX14914_H
35 
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include "no_os_gpio.h"
39 #include "no_os_util.h"
40 
47 };
48 
52 struct max14914_desc {
59 };
60 
70 };
71 
72 /* Set the state of the MAX14914. */
73 int max14914_set_state(struct max14914_desc *desc, enum max14914_state state);
74 
75 /* Initialize the MAX14914 device descriptor. */
76 int max14914_init(struct max14914_desc **desc,
78 
79 /* Free resources allocate by the init function. */
80 int max14914_remove(struct max14914_desc *desc);
81 
82 #endif /* _MAX14914_H */
max14914_init_param::doilvl_init_param
struct no_os_gpio_init_param * doilvl_init_param
Definition: max14914.h:66
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
max14914_desc::di_en_gpio
struct no_os_gpio_desc * di_en_gpio
Definition: max14914.h:56
MAX14914_DIGITAL_OUTPUT_HIGH_SIDE
@ MAX14914_DIGITAL_OUTPUT_HIGH_SIDE
Definition: max14914.h:43
MAX14914_DIGITAL_OUTPUT_LOW_SIDE
@ MAX14914_DIGITAL_OUTPUT_LOW_SIDE
Definition: max14914.h:44
max14914_desc::current_state
enum max14914_state current_state
Definition: max14914.h:53
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
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
max14914_desc::fault_gpio
struct no_os_gpio_desc * fault_gpio
Definition: max14914.h:54
MAX14914_DIGITAL_OUTPUT_PP
@ MAX14914_DIGITAL_OUTPUT_PP
Definition: max14914.h:42
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
max14914_init_param::di_en_init_param
struct no_os_gpio_init_param * di_en_init_param
Definition: max14914.h:67
no_os_error.h
Error codes definition.
max14914_init_param::in_init_param
struct no_os_gpio_init_param * in_init_param
Definition: max14914.h:68
max14914_desc::in_gpio
struct no_os_gpio_desc * in_gpio
Definition: max14914.h:57
max14914_init_param::fault_init_param
struct no_os_gpio_init_param * fault_init_param
Definition: max14914.h:65
max14914_init_param
Structure holding the MAX14914 initialization parameter.
Definition: max14914.h:64
max14914_init_param::pp_init_param
struct no_os_gpio_init_param * pp_init_param
Definition: max14914.h:69
MAX14914_DIGITAL_INPUT_IEC_TYPE2
@ MAX14914_DIGITAL_INPUT_IEC_TYPE2
Definition: max14914.h:46
max14914_init
int max14914_init(struct max14914_desc **desc, struct max14914_init_param *init_param)
Initialize the MAX14914 device.
Definition: max14914.c:124
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
max14914_remove
int max14914_remove(struct max14914_desc *desc)
Free resources allocated by the init function.
Definition: max14914.c:204
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
max14914_state
max14914_state
Definition: max14914.h:41
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
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
max14914_set_state
int max14914_set_state(struct max14914_desc *desc, enum max14914_state state)
Set the state of the MAX14914.
Definition: max14914.c:46
max14914.h
Header file of MAX14914 Driver.
max14914_desc::doilvl_gpio
struct no_os_gpio_desc * doilvl_gpio
Definition: max14914.h:55
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
max14914_desc
Structure holding the MAX14914 device descriptor.
Definition: max14914.h:52
max14914_desc::pp_gpio
struct no_os_gpio_desc * pp_gpio
Definition: max14914.h:58
no_os_gpio.h
Header file of GPIO Interface.
no_os_util.h
Header file of utility functions.
MAX14914_DIGITAL_INPUT_IEC_TYPE1_3
@ MAX14914_DIGITAL_INPUT_IEC_TYPE1_3
Definition: max14914.h:45
max14914_init
int max14914_init(struct max14914_desc **desc, struct max14914_init_param *init_param)
Initialize the MAX14914 device.
Definition: max14914.c:124
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
max14914_set_state
int max14914_set_state(struct max14914_desc *desc, enum max14914_state state)
Set the state of the MAX14914.
Definition: max14914.c:46
max14914_remove
int max14914_remove(struct max14914_desc *desc)
Free resources allocated by the init function.
Definition: max14914.c:204