From a87f059b7acdc9f00b2102249a647a51f8389de4 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Mon, 14 Apr 2008 12:00:59 +0200 Subject: * digital/io/src * asserv - improve the API of the arm functions to ease usage ; - add a new function to put the arm to the position to close the input hole. * get sample FSM - keep only the needed and real events ; - correctly names the states ; - improve the function to select where to put the samples ; * general - add headers for some standard configuration defines. * trap - add another entry to the enum to know its length. --- digital/io/src/getsamples.h | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) (limited to 'digital/io/src/getsamples.h') diff --git a/digital/io/src/getsamples.h b/digital/io/src/getsamples.h index 6bfb3d63..c033665d 100644 --- a/digital/io/src/getsamples.h +++ b/digital/io/src/getsamples.h @@ -25,29 +25,48 @@ * * }}} */ -/** getsamples FSM associated data. */ +/** + * Get samples FSM associated data. + */ struct getsamples_data_t { - /* Distributor x position to get samples. */ + /** + * X position of the distributor where to get samples from. + */ uint32_t distributor_x; - /* Distributor y position to get samples. */ + /** + * Y position of the distributor where to get samples from. + */ uint32_t distributor_y; - /* Samples to take. */ - uint8_t samples; - /* event of the main fsm to post. */ + /** + * Bit field to indicate where to put the sample. + * If bit 0 is set to 1, a sample will be put into the out_right_box. If + * set to 0, the out_right_box will not be used to store a sample. + */ + uint8_t sample_bitfield; + /** + * Event to post to the top FSM when this one is finished. + */ uint8_t event; }; -/** getsamples global. */ +/** + * Get samples shared data. + */ extern struct getsamples_data_t getsamples_data; -/** Start a getsamples FSM. */ +/** + * Start the get samples FSM. + * @param data get sample data initial configuration. + */ void -getsamples_start (uint32_t distributor_x, uint32_t distributor_y, - uint8_t samples, uint8_t event_to_post); +getsamples_start (struct getsamples_data_t data); -/** Configure the classifier using the bit fields in the getsamples_data - * structure. +/** + * Configure the classifier (using the trap and the internal bit field) for + * the first bit set to 1. + * After the configuring the classifier, the bit will be reset to 0 to use the + * next one when calling this function again. */ void getsamples_configure_classifier (void); -- cgit v1.2.3