This is the hardware independent BSP (Board Support Package) Interface for Mynewt.
Contains the basic operations to initialize, specify memory to include in coredump, configure interrupt priority etc.
Initializes BSP; registers flash_map with the system.
Intended to be called from bootloader before it call application reset handler. It should leave resources (timers/DMA/peripherals) in a state that nothing unexpected is active before application code is ready to handle it.
const struct hal_flash *
const struct hal_bsp_mem_dump *
Report which memory areas should be included inside a coredump.
Retrieves the length, in bytes, of the hardware ID.
The length of the hardware ID.
hal_bsp_hw_id(uint8_t *id, int max_len)¶
Get unique HW identifier/serial number for platform.
Returns the number of bytes filled in.
0 on success, non-zero error code on failure
id: Pointer to the ID to fill out
max_len: Maximum length to fill into the ID
Move the system into the specified power state.
0 on success, non-zero if system cannot move into this power state.
state: The power state to move the system into, this is one of
HAL_BSP_POWER_ON: Full system on
HAL_BSP_POWER_WFI: Processor off, wait for interrupt.
HAL_BSP_POWER_SLEEP: Put the system to sleep
HAL_BSP_POWER_DEEP_SLEEP: Put the system into deep sleep.
HAL_BSP_POWER_OFF: Turn off the system.
HAL_BSP_POWER_PERUSER: From this value on, allow user defined power states.
hal_bsp_get_nvic_priority(int irq_num, uint32_t pri)¶
Returns priority of given interrupt number.
Full System On.
Wait for Interrupt: CPU off.
System sleep mode, processor off, some peripherals off too.
Deep sleep: possible loss of RAM retention, system wakes up in undefined state.
System powering off.
Per-user power state, base number for user to define custom power states.
- #include <hal_bsp.h>