|
|
|
@ -158,7 +158,7 @@ typedef int8_t pin_t;
|
|
|
|
|
// Public Variables
|
|
|
|
|
// ------------------------
|
|
|
|
|
|
|
|
|
|
/** result of last ADC conversion */
|
|
|
|
|
// Result of last ADC conversion
|
|
|
|
|
extern uint16_t HAL_adc_result;
|
|
|
|
|
|
|
|
|
|
// ------------------------
|
|
|
|
@ -174,14 +174,17 @@ extern uint16_t HAL_adc_result;
|
|
|
|
|
// Memory related
|
|
|
|
|
#define __bss_end __bss_end__
|
|
|
|
|
|
|
|
|
|
/** clear reset reason */
|
|
|
|
|
// Clear reset reason
|
|
|
|
|
void HAL_clear_reset_source(void);
|
|
|
|
|
|
|
|
|
|
/** reset reason */
|
|
|
|
|
// Reset reason
|
|
|
|
|
uint8_t HAL_get_reset_source(void);
|
|
|
|
|
|
|
|
|
|
void _delay_ms(const int delay);
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
extern "C" {
|
|
|
|
|
int freeMemory(void);
|
|
|
|
@ -189,6 +192,7 @@ extern "C" {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
extern "C" char* _sbrk(int incr);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
static int freeMemory() {
|
|
|
|
|
volatile int top;
|
|
|
|
@ -197,9 +201,6 @@ static int freeMemory() {
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
|
|
|
|
|
|
|
|
|
static int freeMemory() {
|
|
|
|
|
volatile char top;
|
|
|
|
|
return &top - reinterpret_cast<char*>(_sbrk(0));
|
|
|
|
@ -211,11 +212,11 @@ static int freeMemory() {
|
|
|
|
|
// SPI: Extended functions which take a channel number (hardware SPI only)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
/** Write single byte to specified SPI channel */
|
|
|
|
|
// Write single byte to specified SPI channel
|
|
|
|
|
void spiSend(uint32_t chan, byte b);
|
|
|
|
|
/** Write buffer to specified SPI channel */
|
|
|
|
|
// 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 */
|
|
|
|
|
// Read single byte from specified SPI channel
|
|
|
|
|
uint8_t spiRec(uint32_t chan);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|