Custom version for NXP cup car
Fork of FRDM-TFC by
Diff: TFC.h
- Revision:
- 9:0c6d78c56091
- Parent:
- 3:23cce037011f
--- a/TFC.h Thu Feb 11 14:58:08 2016 +0000 +++ b/TFC.h Thu Jun 01 13:16:37 2017 +0000 @@ -85,6 +85,12 @@ #define TAOS_SI_HIGH PTD->PSOR = (1<<7) #define TAOS_SI_LOW PTD->PCOR = (1<<7) +#define ADC_MASK_CAPTURE_POT_0 1 +#define ADC_MASK_CAPTURE_POT_1 2 +#define ADC_MASK_CAPTURE_BATTERY_LEVEL 4 +#define ADC_MASK_CAPTURE_MOTOR_CURRENT 8 +#define ADC_MASK_CAPTURE_LINE_SCAN 16 +#define ADC_MASK_CAPTURE_ALL 31 /** @@ -211,13 +217,29 @@ */ float TFC_ReadPot(uint8_t Channel); + +uint16_t TFC_ReadBatteryVoltageRaw(); +uint16_t TFC_ReadMotACurrentRaw(); +uint16_t TFC_ReadMotBCurrentRaw(); + + /** Gets the current battery voltage * * @returns Battery voltage in floating point form. */ float TFC_ReadBatteryVoltage(); +/** Gets motor A current +* +* @returns Current value in amps in floating point form. +*/ +float TFC_ReadMotACurrent(); +/** Gets motor B current +* +* @returns Current value in amps in floating point form. +*/ +float TFC_ReadMotBCurrent(); /** Sets the Battery level indiciate * @@ -226,6 +248,16 @@ */ void TFC_SetBatteryLED_Level(uint8_t BattLevel); +/** Stop camera exposure +* +*/ +void TFC_StopCameraExposure(); + +/** Start ADC convertion of all analog inputs +* +* @param mask The mask of convertions to perform +*/ +void TFC_StartDataAcquisition(uint8_t mask); /** Pointer to two channels of line scan camera data. Each channel is 128 points of uint8_t's. Note that the underlying implementation is ping-pong buffer These pointers will point to the *inactive buffer. @@ -241,10 +273,12 @@ */ extern volatile uint8_t TFC_LineScanImageReady; - +extern volatile uint8_t TFC_Pot0Ready; +extern volatile uint8_t TFC_Pot1Ready; +extern volatile uint8_t TFC_BatteryVoltageReady; +extern volatile uint8_t TFC_MotorCurrentReady; - - +extern FunctionPointer TFC_ConvertionReadyCallback; /** @} */