Verified Commit 37daca63 authored by Rahix's avatar Rahix
Browse files

feat(epicardium): Add module for hardware init

Signed-off-by: Rahix's avatarRahix <>
parent bb54b68b
......@@ -36,7 +36,8 @@ int main(void)
LOG_INFO("startup", "Epicardium startup ...");
LOG_INFO("startup", "Version " CARD10_VERSION);
// card10_diag();
......@@ -159,6 +160,8 @@ int main(void)
core1_load((void *)0x10080000, "");
LOG_INFO("startup", "Starting FreeRTOS ...");
#include "modules/modules.h"
#include "card10.h"
* Early init is called at the very beginning and is meant for modules which
* absolutely need to start as soon as possible. hardware_early_init() blocks
* which means code in here should be fast.
int hardware_early_init(void)
return 0;
* hardware_init() is called after the core has been bootstrapped and is meant
* for less critical initialization steps. Modules which initialize here should
* be robust against a l0dable using their API before initialization is done.
* Ideally, acquire a lock in hardware_early_init() and release it in
* hardware_init() once initialization is done.
int hardware_init(void)
return 0;
* hardware_reset() is called whenever a new l0dable is started. hardware_reset()
* should bring all peripherals back into a known initial state. This does not
* necessarily mean resetting the peripheral entirely but hardware_reset()
* should at least bring the API facing part of a peripheral back into the state
* a fresh booted l0dable expects.
int hardware_reset(void)
  • This call takes quite some time as it initializes things like the display. We should do a more granular reset soon.

  • Yes! card10_init() does a lot of things which should not happen here. I will work on this next.

Please register or sign in to reply
return 0;
......@@ -2,6 +2,7 @@ module_sources = files(
......@@ -11,6 +11,11 @@ void vApiDispatcher(void *pvParameters);
extern SemaphoreHandle_t api_mutex;
extern TaskHandle_t dispatcher_task_id;
/* ---------- Hardware Init & Reset ---------------------------------------- */
int hardware_early_init(void);
int hardware_init(void);
int hardware_reset(void);
/* ---------- Serial ------------------------------------------------------- */
void vSerialTask(void *pvParameters);
......@@ -27,4 +32,5 @@ void ble_uart_write(uint8_t *pValue, uint8_t len);
// Forces an unlock of the display. Only to be used in epicardium
void disp_forcelock();
#endif /* MODULES_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment