1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
typedef pair<int, int> pair_key;
typedef tuple<int, int, int> tuple_vals;
typedef map< pair<int, int>, tuple<int, int, int> > pair_tuple_map_type;
pair_tuple_map_type lookup_pins
{ // Brd, BNK, srclk, rclk, ser_data
{ {1,0}, {(PD_13), (PD_12), (PE_15)} }, { {1,1}, {(PD_13), (PD_12), (PF_13)} },
{ {2,0}, {(PD_14), (PD_15), (PF_14)} }, { {2,1}, {(PD_14), (PD_15), (PF_15)} },
};
void set_to_fast()
{
serial_str_write("\n");
serial_str_write( "Setting to fast:\n" );
int sr, rc, s0;
for (const auto &lookup_row : lookup_pins)
{
auto key_pair = lookup_row.first;
// auto [srclk, rclk, ser_data] = lookup_row.second;
static auto map_vals = lookup_row.second;
// static int sr = get<0>(map_vals);
// static int rc = get<1>(map_vals);
// static int s0 = get<2>(map_vals);
tie(sr, rc, s0) = map_vals;
serial_str_write("\n"); serial_str_write( "Sr: " ); serial_int_write(sr); serial_str_write("\n");
serial_str_write("\n"); serial_str_write( "Rc: " ); serial_int_write(rc); serial_str_write("\n");
serial_str_write("\n"); serial_str_write( "S0: " ); serial_int_write(s0); serial_str_write("\n");
}
}
|