Functions
commands.c File Reference
#include "commands.h"
#include "ch.h"
#include "hal.h"
#include "main.h"
#include "stm32f4xx_conf.h"
#include "servo.h"
#include "servo_simple.h"
#include "buffer.h"
#include "myUSB.h"
#include "terminal.h"
#include "hw.h"
#include "mcpwm.h"
#include "app.h"
#include "timeout.h"
#include "servo_dec.h"
#include "comm_can.h"
#include "flash_helper.h"
#include "utils.h"
#include "packet.h"
#include <math.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>

Functions

void commands_init (void)
 
void commands_set_send_func (void(*func)(unsigned char *data, unsigned int len))
 
void commands_send_packet (unsigned char *data, unsigned int len)
 
void commands_process_packet (unsigned char *data, unsigned int len)
 
void commands_printf (char *format,...)
 
void commands_send_samples (uint8_t *data, int len)
 
void commands_send_rotor_pos (float rotor_pos)
 
void commands_send_experiment_samples (float *samples, int len)
 

Function Documentation

void commands_init ( void  )
void commands_printf ( char *  format,
  ... 
)
void commands_process_packet ( unsigned char *  data,
unsigned int  len 
)

Process a received buffer with commands and data.

Parameters
dataThe buffer to process.
lenThe length of the buffer.
void commands_send_experiment_samples ( float *  samples,
int  len 
)
void commands_send_packet ( unsigned char *  data,
unsigned int  len 
)

Send a packet using the set send function.

Parameters
dataThe packet data.
lenThe data length.
void commands_send_rotor_pos ( float  rotor_pos)
void commands_send_samples ( uint8_t *  data,
int  len 
)
void commands_set_send_func ( void(*)(unsigned char *data, unsigned int len)  func)

Provide a function to use the next time there are packets to be sent.

Parameters
funcA pointer to the packet sending function.