no-OS
max14914.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef _MAX14914_H
40 #define _MAX14914_H
41 
42 #include <stdint.h>
43 #include <stdbool.h>
44 #include "no_os_gpio.h"
45 #include "no_os_util.h"
46 
53 };
54 
58 struct max14914_desc {
65 };
66 
76 };
77 
78 /* Set the state of the MAX14914. */
79 int max14914_set_state(struct max14914_desc *desc, enum max14914_state state);
80 
81 /* Initialize the MAX14914 device descriptor. */
82 int max14914_init(struct max14914_desc **desc,
84 
85 /* Free resources allocate by the init function. */
86 int max14914_remove(struct max14914_desc *desc);
87 
88 #endif /* _MAX14914_H */
max14914_init_param::doilvl_init_param
struct no_os_gpio_init_param * doilvl_init_param
Definition: max14914.h:72
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
max14914_desc::di_en_gpio
struct no_os_gpio_desc * di_en_gpio
Definition: max14914.h:62
MAX14914_DIGITAL_OUTPUT_HIGH_SIDE
@ MAX14914_DIGITAL_OUTPUT_HIGH_SIDE
Definition: max14914.h:49
MAX14914_DIGITAL_OUTPUT_LOW_SIDE
@ MAX14914_DIGITAL_OUTPUT_LOW_SIDE
Definition: max14914.h:50
max14914_desc::current_state
enum max14914_state current_state
Definition: max14914.h:59
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
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
max14914_desc::fault_gpio
struct no_os_gpio_desc * fault_gpio
Definition: max14914.h:60
MAX14914_DIGITAL_OUTPUT_PP
@ MAX14914_DIGITAL_OUTPUT_PP
Definition: max14914.h:48
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
max14914_init_param::di_en_init_param
struct no_os_gpio_init_param * di_en_init_param
Definition: max14914.h:73
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:74
max14914_desc::in_gpio
struct no_os_gpio_desc * in_gpio
Definition: max14914.h:63
max14914_init_param::fault_init_param
struct no_os_gpio_init_param * fault_init_param
Definition: max14914.h:71
max14914_init_param
Structure holding the MAX14914 initialization parameter.
Definition: max14914.h:70
max14914_init_param::pp_init_param
struct no_os_gpio_init_param * pp_init_param
Definition: max14914.h:75
MAX14914_DIGITAL_INPUT_IEC_TYPE2
@ MAX14914_DIGITAL_INPUT_IEC_TYPE2
Definition: max14914.h:52
max14914_init
int max14914_init(struct max14914_desc **desc, struct max14914_init_param *init_param)
Initialize the MAX14914 device.
Definition: max14914.c:130
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
max14914_remove
int max14914_remove(struct max14914_desc *desc)
Free resources allocated by the init function.
Definition: max14914.c:210
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
max14914_state
max14914_state
Definition: max14914.h:47
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
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
max14914_set_state
int max14914_set_state(struct max14914_desc *desc, enum max14914_state state)
Set the state of the MAX14914.
Definition: max14914.c:52
max14914.h
Header file of MAX14914 Driver.
max14914_desc::doilvl_gpio
struct no_os_gpio_desc * doilvl_gpio
Definition: max14914.h:61
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
max14914_desc
Structure holding the MAX14914 device descriptor.
Definition: max14914.h:58
max14914_desc::pp_gpio
struct no_os_gpio_desc * pp_gpio
Definition: max14914.h:64
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:51
max14914_init
int max14914_init(struct max14914_desc **desc, struct max14914_init_param *init_param)
Initialize the MAX14914 device.
Definition: max14914.c:130
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
max14914_set_state
int max14914_set_state(struct max14914_desc *desc, enum max14914_state state)
Set the state of the MAX14914.
Definition: max14914.c:52
max14914_remove
int max14914_remove(struct max14914_desc *desc)
Free resources allocated by the init function.
Definition: max14914.c:210