-
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 #348 from Luos-io/rc_2.7.0
Luos Engine release 2.7.0
- Loading branch information
Showing
228 changed files
with
2,546 additions
and
258 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,227 @@ | ||
/****************************************************************************** | ||
* @file luosHAL | ||
* @brief Luos Hardware Abstration Layer. Describe Low layer fonction | ||
* @Family x86/Linux/Mac | ||
* @author Luos | ||
* @version 0.0.0 | ||
******************************************************************************/ | ||
#include "luos_hal.h" | ||
|
||
#include <stdio.h> | ||
#include <time.h> | ||
#include <stdbool.h> | ||
#include <string.h> | ||
|
||
/******************************************************************************* | ||
* Function | ||
******************************************************************************/ | ||
static void LuosHAL_SystickInit(void); | ||
static void LuosHAL_FlashInit(void); | ||
static void LuosHAL_FlashEraseLuosMemoryInfo(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 None | ||
* @return None | ||
******************************************************************************/ | ||
void LuosHAL_SetIrqState(uint8_t 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 | ||
******************************************************************************/ | ||
uint32_t LuosHAL_GetSystick(void) | ||
{ | ||
clock_t tick = clock(); | ||
return tick; // return tick | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Luos GetTimestamp | ||
* @param None | ||
* @return uint64_t | ||
******************************************************************************/ | ||
uint64_t LuosHAL_GetTimestamp(void) | ||
{ | ||
return (LuosHAL_GetSystick() * 1000); | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Luos start Timestamp | ||
* @param None | ||
* @return None | ||
******************************************************************************/ | ||
void LuosHAL_StartTimestamp(void) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Luos stop Timestamp | ||
* @param None | ||
* @return None | ||
******************************************************************************/ | ||
void LuosHAL_StopTimestamp(void) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Flash Initialisation | ||
* @param None | ||
* @return None | ||
******************************************************************************/ | ||
static void LuosHAL_FlashInit(void) | ||
{ | ||
for (uint16_t i = 0; i < FLASH_PAGE_NUMBER; i++) | ||
{ | ||
for (uint16_t j = 0; j < FLASH_PAGE_SIZE; j++) | ||
{ | ||
stub_flash_x86[i][j] = 0; | ||
} | ||
} | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Erase flash page where Luos keep permanente information | ||
* @param None | ||
* @return None | ||
******************************************************************************/ | ||
static void LuosHAL_FlashEraseLuosMemoryInfo(void) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Write flash page where Luos keep permanente information | ||
* @param Address page / size to write / pointer to data to write | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief read information from page where Luos keep permanente information | ||
* @param Address info / size to read / pointer callback data to read | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data) | ||
{ | ||
memset(data, 0xFF, size); | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Set boot mode in shared flash memory | ||
* @param | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_SetMode(uint8_t mode) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Save node ID in shared flash memory | ||
* @param Address, node_id | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_SaveNodeID(uint16_t node_id) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief software reboot the microprocessor | ||
* @param | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_Reboot(void) | ||
{ | ||
} | ||
|
||
#ifdef BOOTLOADER_CONFIG | ||
/****************************************************************************** | ||
* @brief DeInit Bootloader peripherals | ||
* @param | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_DeInit(void) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief DeInit Bootloader peripherals | ||
* @param | ||
* @return | ||
******************************************************************************/ | ||
typedef void (*pFunction)(void); /*!< Function pointer definition */ | ||
|
||
void LuosHAL_JumpToApp(uint32_t app_addr) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Return bootloader mode saved in flash | ||
* @param | ||
* @return | ||
******************************************************************************/ | ||
uint8_t LuosHAL_GetMode(void) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Get node id saved in flash memory | ||
* @param Address | ||
* @return node_id | ||
******************************************************************************/ | ||
uint16_t LuosHAL_GetNodeID(void) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief erase sectors in flash memory | ||
* @param Address, size | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_EraseMemory(uint32_t address, uint16_t size) | ||
{ | ||
} | ||
|
||
/****************************************************************************** | ||
* @brief Save binary data in shared flash memory | ||
* @param Address, size, data[] | ||
* @return | ||
******************************************************************************/ | ||
void LuosHAL_ProgramFlash(uint32_t address, uint16_t size, uint8_t *data) | ||
{ | ||
} | ||
#endif |
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,58 @@ | ||
/****************************************************************************** | ||
* @file luosHAL | ||
* @brief Luos Hardware Abstration Layer. Describe Low layer fonction | ||
* @Family x86/Linux/Mac | ||
* @author Luos | ||
* @version 0.0.0 | ||
******************************************************************************/ | ||
#ifndef _LUOSHAL_H_ | ||
#define _LUOSHAL_H_ | ||
|
||
#include <stdint.h> | ||
#include <luos_hal_config.h> | ||
|
||
/******************************************************************************* | ||
* Definitions | ||
******************************************************************************/ | ||
#ifndef _CRITICAL | ||
#define _CRITICAL | ||
#endif | ||
|
||
#define LUOS_UUID ((uint32_t *)0x00000001) | ||
|
||
#define ADDRESS_ALIASES_FLASH ADDRESS_LAST_PAGE_FLASH | ||
#define ADDRESS_BOOT_FLAG_FLASH (ADDRESS_LAST_PAGE_FLASH + PAGE_SIZE) - 4 | ||
|
||
/******************************************************************************* | ||
* Variables | ||
******************************************************************************/ | ||
|
||
/******************************************************************************* | ||
* Function | ||
******************************************************************************/ | ||
void LuosHAL_Init(void); | ||
void LuosHAL_SetIrqState(uint8_t Enable); | ||
uint32_t LuosHAL_GetSystick(void); | ||
void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); | ||
void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); | ||
|
||
// bootloader functions | ||
void LuosHAL_SetMode(uint8_t mode); | ||
void LuosHAL_Reboot(void); | ||
void LuosHAL_SaveNodeID(uint16_t); | ||
|
||
#ifdef BOOTLOADER_CONFIG | ||
void LuosHAL_DeInit(void); | ||
void LuosHAL_JumpToApp(uint32_t); | ||
uint8_t LuosHAL_GetMode(void); | ||
uint16_t LuosHAL_GetNodeID(void); | ||
void LuosHAL_EraseMemory(uint32_t, uint16_t); | ||
void LuosHAL_ProgramFlash(uint32_t, uint16_t, uint8_t *); | ||
#endif | ||
|
||
// timestamp functions | ||
uint64_t LuosHAL_GetTimestamp(void); | ||
void LuosHAL_StartTimestamp(void); | ||
void LuosHAL_StopTimestamp(void); | ||
|
||
#endif /* _LUOSHAL_H_ */ |
Oops, something went wrong.