8 #include "hardware/pio.h"
15 #define hx711_reader_wrap_target 3
16 #define hx711_reader_wrap 13
18 #define hx711_reader_HZ 10000000
47 pio_sm_config c = pio_get_default_sm_config();
49 sm_config_set_sideset(&c, 2,
true,
false);
76 #include "hardware/clocks.h"
77 #include "hardware/pio.h"
78 #include "hardware/structs/clocks.h"
82 assert(hx->
_pio != NULL);
97 pio_sm_set_consecutive_pindirs(
111 pio_sm_set_consecutive_pindirs(
120 assert(hx->
_pio != NULL);
123 const float div = (float)(clock_get_hz(clk_sys)) / (uint)
hx711_reader_HZ;
124 sm_config_set_clkdiv(
127 sm_config_set_set_pins(
131 sm_config_set_out_pins(
135 sm_config_set_sideset_pins(
138 sm_config_set_in_pins(
160 sm_config_set_in_shift(
static const struct pio_program hx711_reader_program
#define hx711_reader_wrap
#define hx711_reader_wrap_target
void hx711_reader_program_init(hx711_t *const hx)
static const uint16_t hx711_reader_program_instructions[]
void hx711_reader_pio_init(hx711_t *const hx)
static pio_sm_config hx711_reader_program_get_default_config(uint offset)
pio_sm_config _reader_prog_default_config