mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Switches HAL to fixed length signed integers, and adds our own HAL_Bool Type (#155)
* Switches HAL to fixed length signed integers, and adds our own HAL_Bool type * Replaces HAL Floats with Doubles Doubles are just as fast as floats with optimizations turned on, so switches to all doubles. All made doubles for consistency. * Prepends HAL/ to HAL include files. Also fixes some range errors
This commit is contained in:
committed by
Peter Johnson
parent
4a98e68815
commit
b51e85ae26
@@ -9,35 +9,37 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" {
|
||||
void HAL_InitializeSPI(uint8_t port, int32_t* status);
|
||||
int32_t HAL_TransactionSPI(uint8_t port, uint8_t* dataToSend,
|
||||
uint8_t* dataReceived, uint8_t size);
|
||||
int32_t HAL_WriteSPI(uint8_t port, uint8_t* dataToSend, uint8_t sendSize);
|
||||
int32_t HAL_ReadSPI(uint8_t port, uint8_t* buffer, uint8_t count);
|
||||
void HAL_CloseSPI(uint8_t port);
|
||||
void HAL_SetSPISpeed(uint8_t port, uint32_t speed);
|
||||
void HAL_SetSPIOpts(uint8_t port, int msb_first, int sample_on_trailing,
|
||||
int clk_idle_high);
|
||||
void HAL_SetSPIChipSelectActiveHigh(uint8_t port, int32_t* status);
|
||||
void HAL_SetSPIChipSelectActiveLow(uint8_t port, int32_t* status);
|
||||
int32_t HAL_GetSPIHandle(uint8_t port);
|
||||
void HAL_SetSPIHandle(uint8_t port, int32_t handle);
|
||||
#include "HAL/Types.h"
|
||||
|
||||
void HAL_InitSPIAccumulator(uint8_t port, uint32_t period, uint32_t cmd,
|
||||
uint8_t xfer_size, uint32_t valid_mask,
|
||||
uint32_t valid_value, uint8_t data_shift,
|
||||
uint8_t data_size, bool is_signed, bool big_endian,
|
||||
int32_t* status);
|
||||
void HAL_FreeSPIAccumulator(uint8_t port, int32_t* status);
|
||||
void HAL_ResetSPIAccumulator(uint8_t port, int32_t* status);
|
||||
void HAL_SetSPIAccumulatorCenter(uint8_t port, int32_t center, int32_t* status);
|
||||
void HAL_SetSPIAccumulatorDeadband(uint8_t port, int32_t deadband,
|
||||
extern "C" {
|
||||
void HAL_InitializeSPI(int32_t port, int32_t* status);
|
||||
int32_t HAL_TransactionSPI(int32_t port, uint8_t* dataToSend,
|
||||
uint8_t* dataReceived, int32_t size);
|
||||
int32_t HAL_WriteSPI(int32_t port, uint8_t* dataToSend, int32_t sendSize);
|
||||
int32_t HAL_ReadSPI(int32_t port, uint8_t* buffer, int32_t count);
|
||||
void HAL_CloseSPI(int32_t port);
|
||||
void HAL_SetSPISpeed(int32_t port, int32_t speed);
|
||||
void HAL_SetSPIOpts(int32_t port, HAL_Bool msb_first,
|
||||
HAL_Bool sample_on_trailing, HAL_Bool clk_idle_high);
|
||||
void HAL_SetSPIChipSelectActiveHigh(int32_t port, int32_t* status);
|
||||
void HAL_SetSPIChipSelectActiveLow(int32_t port, int32_t* status);
|
||||
int32_t HAL_GetSPIHandle(int32_t port);
|
||||
void HAL_SetSPIHandle(int32_t port, int32_t handle);
|
||||
|
||||
void HAL_InitSPIAccumulator(int32_t port, int32_t period, int32_t cmd,
|
||||
int32_t xfer_size, int32_t valid_mask,
|
||||
int32_t valid_value, int32_t data_shift,
|
||||
int32_t data_size, HAL_Bool is_signed,
|
||||
HAL_Bool big_endian, int32_t* status);
|
||||
void HAL_FreeSPIAccumulator(int32_t port, int32_t* status);
|
||||
void HAL_ResetSPIAccumulator(int32_t port, int32_t* status);
|
||||
void HAL_SetSPIAccumulatorCenter(int32_t port, int32_t center, int32_t* status);
|
||||
void HAL_SetSPIAccumulatorDeadband(int32_t port, int32_t deadband,
|
||||
int32_t* status);
|
||||
int32_t HAL_GetSPIAccumulatorLastValue(uint8_t port, int32_t* status);
|
||||
int64_t HAL_GetSPIAccumulatorValue(uint8_t port, int32_t* status);
|
||||
uint32_t HAL_GetSPIAccumulatorCount(uint8_t port, int32_t* status);
|
||||
double HAL_GetSPIAccumulatorAverage(uint8_t port, int32_t* status);
|
||||
void HAL_GetSPIAccumulatorOutput(uint8_t port, int64_t* value, uint32_t* count,
|
||||
int32_t HAL_GetSPIAccumulatorLastValue(int32_t port, int32_t* status);
|
||||
int64_t HAL_GetSPIAccumulatorValue(int32_t port, int32_t* status);
|
||||
int64_t HAL_GetSPIAccumulatorCount(int32_t port, int32_t* status);
|
||||
double HAL_GetSPIAccumulatorAverage(int32_t port, int32_t* status);
|
||||
void HAL_GetSPIAccumulatorOutput(int32_t port, int64_t* value, int64_t* count,
|
||||
int32_t* status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user