-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #435 from Luos-io/feat/isolate_robus
Any kind of network support + multi-phy, fix #428
- Loading branch information
Showing
842 changed files
with
21,900 additions
and
42,265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
/****************************************************************************** | ||
* @file luosHAL | ||
* @brief Luos Hardware Abstration Layer. Describe Low layer fonction | ||
* @MCU Family ATSAMD21 | ||
* @author Luos | ||
* @version 0.0.0 | ||
******************************************************************************/ | ||
#include "luos_hal.h" | ||
|
||
#include <stdbool.h> | ||
#include <string.h> | ||
|
||
// MCU dependencies this HAL is for family Atmel ATSAMD21 you can find | ||
|
||
/******************************************************************************* | ||
* Definitions | ||
******************************************************************************/ | ||
#define DEFAULT_TIMEOUT 30 | ||
#define TIMEOUT_ACK DEFAULT_TIMEOUT / 4 | ||
/******************************************************************************* | ||
* Variables | ||
******************************************************************************/ | ||
|
||
// timestamp variable | ||
uint64_t start_offset; | ||
/******************************************************************************* | ||
* Function | ||
******************************************************************************/ | ||
static void LuosHAL_SystickInit(void); | ||
static void LuosHAL_FlashInit(void); | ||
|
||
/////////////////////////Luos Library Needed function/////////////////////////// | ||
|
||
/****************************************************************************** | ||
* @brief Luos HAL general initialisation | ||
* @param None | ||
* @return None | ||
******************************************************************************/ | ||
void LuosHAL_Init(void) | ||
{ | ||
// Systick Initialization | ||
LuosHAL_SystickInit(); | ||
|
||
// Flash Initialization | ||
LuosHAL_FlashInit(); | ||
|
||
// start timestamp | ||
LuosHAL_StartTimestamp(); | ||
} | ||
/****************************************************************************** | ||
* @brief Luos HAL general disable IRQ | ||
* @param Enable : Set to "True" to enable IRQ, "False" otherwise | ||
* @return None | ||
******************************************************************************/ | ||
_CRITICAL void LuosHAL_SetIrqState(bool Enable) | ||
{ | ||
} | ||
/****************************************************************************** | ||
* @brief Luos HAL general systick tick at 1ms initialize | ||
* @param None | ||
* @return Tick Counter | ||
******************************************************************************/ | ||
static void LuosHAL_SystickInit(void) | ||
{ | ||
} | ||
/****************************************************************************** | ||
* @brief Luos HAL general systick tick at 1ms | ||
* @param None | ||
* @return Tick Counter | ||
******************************************************************************/ | ||
_CRITICAL uint32_t LuosHAL_GetSystick(void) | ||
{ | ||
return millis(); | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Luos GetTimestamp | ||
* @param None | ||
* @return uint64_t | ||
******************************************************************************/ | ||
_CRITICAL uint64_t LuosHAL_GetTimestamp(void) | ||
{ | ||
return micros() * 1000 - start_offset; | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Luos start Timestamp | ||
* @param None | ||
* @return None | ||
******************************************************************************/ | ||
_CRITICAL void LuosHAL_StartTimestamp(void) | ||
{ | ||
start_offset = LuosHAL_GetSystick(); | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Luos stop Timestamp | ||
* @param None | ||
* @return None | ||
******************************************************************************/ | ||
_CRITICAL void LuosHAL_StopTimestamp(void) | ||
{ | ||
start_offset = 0; | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Flash Initialisation | ||
* @param None | ||
* @return None | ||
******************************************************************************/ | ||
static void LuosHAL_FlashInit(void) | ||
{ | ||
} | ||
/****************************************************************************** | ||
* @brief Set boot mode in shared flash memory | ||
* @param None | ||
* @return | ||
******************************************************************************/ | ||
_CRITICAL void LuosHAL_SetMode(uint8_t mode) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Save node ID in shared flash memory | ||
* @param node_id | ||
* @return | ||
******************************************************************************/ | ||
_CRITICAL void LuosHAL_SaveNodeID(uint16_t node_id) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Software reboot the microprocessor | ||
* @param None | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_Reboot(void) | ||
{ | ||
} | ||
|
||
#ifdef BOOTLOADER | ||
/****************************************************************************** | ||
* @brief Get node id saved in flash memory | ||
* @param Address | ||
* @return node_id | ||
******************************************************************************/ | ||
uint16_t LuosHAL_GetNodeID(void) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Programm flash memory | ||
* @param address : Start address | ||
* @param size :: Data size | ||
* @param data : Pointer to data | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_ProgramFlash(uint32_t address, uint8_t page, uint16_t size, uint8_t *data) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief DeInit Bootloader peripherals | ||
* @param None | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_DeInit(void) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief DeInit Bootloader peripherals | ||
* @param None | ||
* @return | ||
******************************************************************************/ | ||
typedef void (*pFunction)(void); /*!< Function pointer definition */ | ||
|
||
void LuosHAL_JumpToApp(uint32_t app_addr) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Return bootloader mode saved in flash | ||
* @param None | ||
* @return | ||
******************************************************************************/ | ||
uint8_t LuosHAL_GetMode(void) | ||
{ | ||
} | ||
#endif |
Oops, something went wrong.