Appiko
out_pattern_gen.h
1 
31 #ifndef CODEBASE_PERIPHERAL_MODULES_OUT_PATTERN_GEN_H_
32 #define CODEBASE_PERIPHERAL_MODULES_OUT_PATTERN_GEN_H_
33 
34 #include "stdint.h"
35 #include "stdbool.h"
36 
37 #if SYS_CFG_PRESENT == 1
38 #include "sys_config.h"
39 #endif
40 #ifndef MS_TIMER_USED_OUT_GEN
41 #define MS_TIMER_USED_OUT_GEN 1
42 #endif
43 
44 
46 #define OUT_GEN_MAX_TRANSITIONS 64
47 
49 #define OUT_GEN_MAX_NUM_OUT 4
50 
54 typedef struct
55 {
57  uint32_t num_transitions;
60  uint32_t transitions_durations[OUT_GEN_MAX_TRANSITIONS];
65  void (*done_handler)(uint32_t out_gen_state);
68  uint32_t out_gen_state;
70 
78 void out_gen_init(uint32_t num_out, uint32_t * out_pins, bool * out_init_value);
79 
85 void out_gen_start(out_gen_config_t * out_gen_config);
86 
93 void out_gen_stop(bool * out_vals);
94 
99 bool out_gen_is_on(void);
100 
105 uint32_t out_gen_get_ticks(void);
106 
107 #endif /* CODEBASE_PERIPHERAL_MODULES_OUT_PATTERN_GEN_H_ */
108 
uint32_t num_transitions
The number of transitions in this pattern.
uint32_t out_gen_state
State which is to be started with this configuration, passed as an argument with the done_handler.
void out_gen_init(uint32_t num_out, uint32_t *out_pins, bool *out_init_value)
Initialize the output pattern generator module with the information of the pins on which the pattern ...
void out_gen_stop(bool *out_vals)
Stop the output pattern generation and sets the output pins as specified in the arguments.
bool out_gen_is_on(void)
To know if the output pattern generator module is on.
#define OUT_GEN_MAX_TRANSITIONS
Configuration structure for output pattern generation.
#define OUT_GEN_MAX_NUM_OUT
void out_gen_start(out_gen_config_t *out_gen_config)
Start the generation of the pattern with the information provided.
uint32_t out_gen_get_ticks(void)
Function to get ticks since last call of out_gen_start.