12 #include <linux/spi/spidev.h> 23 #include <spi_command_t.hpp> 24 #include <spi_data_t.hpp> 25 #include <spi_torque_t.hpp> 27 #define K_EXPECTED_COMMAND_SIZE 256 28 #define K_WORDS_PER_MESSAGE 66 29 #define K_EXPECTED_DATA_SIZE 116 30 #define K_KNEE_OFFSET_POS 4.35f 32 #define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" 33 #define BYTE_TO_BINARY(byte) \ 34 (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), \ 35 (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), \ 36 (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), \ 37 (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')
spi_data_t * get_spi_data()
void spi_send_receive(spi_command_t *command, spi_data_t *data)
spi_command_t * get_spi_command()