HAL cleanups

This commit is contained in:
Scott Lahteine 2019-02-20 06:13:07 -06:00
parent 89bbc30a09
commit 631d867dc9
5 changed files with 27 additions and 12 deletions

View File

@ -112,10 +112,8 @@ uint8_t HAL_get_reset_source(void); // get reset reason
// Write single byte to specified SPI channel
void spiSend(uint32_t chan, byte b);
// Write buffer to specified SPI channel
void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
// Read single byte from specified SPI channel
uint8_t spiRec(uint32_t chan);

View File

@ -176,7 +176,10 @@ static inline int freeMemory() {
return &top - reinterpret_cast<char*>(_sbrk(0));
}
//
// SPI: Extended functions which take a channel number (hardware SPI only)
//
/** Write single byte to specified SPI channel */
void spiSend(uint32_t chan, byte b);
/** Write buffer to specified SPI channel */
@ -184,18 +187,19 @@ void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
/** Read single byte from specified SPI channel */
uint8_t spiRec(uint32_t chan);
//
// EEPROM
//
/**
* Wire library should work for i2c eeproms.
*/
// Wire library should work for i2c EEPROMs
void eeprom_write_byte(uint8_t *pos, unsigned char value);
uint8_t eeprom_read_byte(uint8_t *pos);
void eeprom_read_block (void *__dst, const void *__src, size_t __n);
void eeprom_update_block (const void *__src, void *__dst, size_t __n);
//
// ADC
//
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)

View File

@ -185,7 +185,10 @@ static int freeMemory() {
return &top - reinterpret_cast<char*>(_sbrk(0));
}
//
// SPI: Extended functions which take a channel number (hardware SPI only)
//
/** Write single byte to specified SPI channel */
void spiSend(uint32_t chan, byte b);
/** Write buffer to specified SPI channel */
@ -193,19 +196,22 @@ void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
/** Read single byte from specified SPI channel */
uint8_t spiRec(uint32_t chan);
//
// EEPROM
//
/**
* TODO: Write all this eeprom stuff. Can emulate eeprom in flash as last resort.
* Wire library should work for i2c eeproms.
* TODO: Write all this EEPROM stuff. Can emulate EEPROM in flash as last resort.
* Wire library should work for i2c EEPROMs.
*/
void eeprom_write_byte(uint8_t *pos, unsigned char value);
uint8_t eeprom_read_byte(uint8_t *pos);
void eeprom_read_block (void *__dst, const void *__src, size_t __n);
void eeprom_update_block (const void *__src, void *__dst, size_t __n);
//
// ADC
//
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT_ANALOG);

View File

@ -195,7 +195,10 @@ static int freeMemory() {
return &top - reinterpret_cast<char*>(_sbrk(0));
}
//
// SPI: Extended functions which take a channel number (hardware SPI only)
//
/** Write single byte to specified SPI channel */
void spiSend(uint32_t chan, byte b);
/** Write buffer to specified SPI channel */
@ -203,18 +206,22 @@ void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
/** Read single byte from specified SPI channel */
uint8_t spiRec(uint32_t chan);
//
// EEPROM
//
/**
* TODO: Write all this eeprom stuff. Can emulate eeprom in flash as last resort.
* Wire library should work for i2c eeproms.
* TODO: Write all this EEPROM stuff. Can emulate EEPROM in flash as last resort.
* Wire library should work for i2c EEPROMs.
*/
void eeprom_write_byte(uint8_t *pos, unsigned char value);
uint8_t eeprom_read_byte(uint8_t *pos);
void eeprom_read_block (void *__dst, const void *__src, size_t __n);
void eeprom_update_block (const void *__src, void *__dst, size_t __n);
//
// ADC
//
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)