59 constexpr std::uint32_t def_pattern = 0x55555500UL;
61 constexpr std::array<std::uint8_t,13> welcome_msg = {
'\n',
'\r',
'U',
'A',
'R',
'T',
' ',
'T',
'e',
's',
't',
'\n',
'\r'};
62 constexpr std::array<std::uint8_t,12> underline_msg = {
'=',
'=',
'=',
'=',
'=',
'=',
'=',
'=',
'=',
'=',
'\n',
'\r'};
64 constexpr std::array<std::uint32_t,20> spw_msg = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
65 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19};
67 enum class spw_error : uint32_t {CREDIT_ERR = 0x02, ESCAPE_ERR = 0x04, DISCONNECT_ERR = 0x08,
68 PARITY_ERR = 0x10, INVALID_ADDR_ERR = 0x80, END_OF_PACKET_ERR = 0x100 };
75 the_uart0.send_n( welcome_msg.begin(), welcome_msg.end() );
77 the_uart0.send_n( underline_msg.begin(), underline_msg.end() );
80 std::uint32_t counter = 0 ;
85 const std::uint32_t link_status = the_spw0.get_link_status();
86 const std::uint8_t link_state = (link_status >> 21) & 0x7;
87 const std::uint8_t link_err = (link_status & 0xF);
88 the_uart0.
send( link_state + 0x30);
89 the_uart0.send( link_err + 0x30);
91 if ((link_status >> 21) == 0x5U)
94 the_spw0.send(def_pattern | counter);
96 the_spw0.send_n(spw_msg.begin(), spw_msg.end());