Advertisement
Guest User

Untitled

a guest
Jan 15th, 2024
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdint.h>
  3. #include <stddef.h>
  4. #include "pru_uart.h"
  5. #include "pru_ecap.h"
  6. #include "sys_gpio.h"
  7.  
  8. // define some r30 bits
  9. #define CW  (1 << 3)
  10. #define CCW (1 << 7)
  11. #define delay_us(n) __delay_cycles((n) * 200u)
  12. #define delay_ms(n) delay_us((n) * 1000u)
  13.    
  14.    
  15. struct Message {
  16.         uint32_t id;
  17.         uint32_t timestamp;
  18.         int32_t control_signal;
  19.         int32_t error_signal;
  20.         int16_t force;
  21.         int16_t cycle_count;
  22.         uint16_t counter;
  23.         uint16_t signal_length;
  24. Type  :qa  and press <Enter> to exit Vim                      1,1           Top
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement