Defines | |
| #define | MEM32(addr) (*((volatile u32 *)(addr))) |
| #define | MEM16(addr) (*((volatile u16 *)(addr))) |
| #define | MEM8(addr) (*((volatile u8 *)(addr))) |
| #define | NUM_DMA_CHANNELS 8 |
| #define | MEM32(addr) (*((volatile u32 *)(addr))) |
| #define | MEM16(addr) (*((volatile u16 *)(addr))) |
| #define | MEM8(addr) (*((volatile u8 *)(addr))) |
| #define | EXT_CRYSTAL_FRQ 12000000 |
| #define | RTC_PREDIVIDER (EXT_CRYSTAL_FRQ/128) |
Functions | |
| s32 | MIOS32_SYS_Init (u32 mode) |
| s32 | MIOS32_SYS_Reset (void) |
| u32 | MIOS32_SYS_ChipIDGet (void) |
| u32 | MIOS32_SYS_FlashSizeGet (void) |
| u32 | MIOS32_SYS_RAMSizeGet (void) |
| s32 | MIOS32_SYS_SerialNumberGet (char *str) |
| s32 | MIOS32_SYS_TimeSet (mios32_sys_time_t t) |
| mios32_sys_time_t | MIOS32_SYS_TimeGet (void) |
| s32 | MIOS32_SYS_DMA_CallbackSet (u8 dma, u8 chn, void *callback) |
| void | DMA_IRQHandler (void) |
Variables | |
| u32 | mios32_sys_isr_vector |
| u32 | mios32_sys_isr_vector |
| #define EXT_CRYSTAL_FRQ 12000000 |
| #define MEM16 | ( | addr | ) | (*((volatile u16 *)(addr))) |
| #define MEM16 | ( | addr | ) | (*((volatile u16 *)(addr))) |
| #define MEM32 | ( | addr | ) | (*((volatile u32 *)(addr))) |
| #define MEM32 | ( | addr | ) | (*((volatile u32 *)(addr))) |
| #define MEM8 | ( | addr | ) | (*((volatile u8 *)(addr))) |
| #define MEM8 | ( | addr | ) | (*((volatile u8 *)(addr))) |
| #define NUM_DMA_CHANNELS 8 |
| #define RTC_PREDIVIDER (EXT_CRYSTAL_FRQ/128) |
| void DMA_IRQHandler | ( | void | ) |
| u32 MIOS32_SYS_ChipIDGet | ( | void | ) |
Returns the Chip ID of the core
Installs a DMA callback function which is invoked on DMA interrupts
Available for LTC17xx (and not STM32) since it only provides a single DMA interrupt which is shared by all channels.
| [in] | dma | the DMA number (currently always 0) |
| [in] | chn | the DMA channel (0..7) |
| [in] | callback | the callback function which will be invoked by DMA ISR |
-2 if invalid DMA number is selected
-2 if invalid DMA channel selected
| u32 MIOS32_SYS_FlashSizeGet | ( | void | ) |
Returns the Flash size of the core
Initializes the System for MIOS32:
| [in] | mode | currently only mode 0 supported |
| u32 MIOS32_SYS_RAMSizeGet | ( | void | ) |
Returns the (data) RAM size of the core
| s32 MIOS32_SYS_Reset | ( | void | ) |
Shutdown MIOS32 and reset the microcontroller:
| s32 MIOS32_SYS_SerialNumberGet | ( | char * | str | ) |
Returns the serial number as a string
| [out] | str | pointer to a string which can store at least 32 digits + zero terminator! (24 digits returned for STM32) |
| mios32_sys_time_t MIOS32_SYS_TimeGet | ( | void | ) |
Returns the System Real Time (with mS accuracy)
Following example code converts the returned time into hours, minutes, seconds and milliseconds:
mios32_sys_time_t t = MIOS32_SYS_TimeGet(); int hours = t.seconds / 3600; int minutes = (t.seconds % 3600) / 60; int seconds = (t.seconds % 3600) % 60; int milliseconds = t.fraction_ms;
| s32 MIOS32_SYS_TimeSet | ( | mios32_sys_time_t | t | ) |
Initializes/Resets the System Real Time Clock, so that MIOS32_SYS_Time() can be used for microsecond accurate measurements.
The time can be re-initialized the following way:
// set System Time to one hour and 30 minutes mios32_sys_time_t t = { .seconds=1*3600 + 30*60, .fraction_ms=0 }; MIOS32_SYS_TimeSet(t);
After system reset it will always start with 0. A battery backup option is not supported by MIOS32
| [in] | t | the time in seconds + fraction part (mS) Note that this format isn't completely compatible to the NTP timestamp format, as the fraction has only mS accuracy |
1.4.7