|
SemiDrive SSDK Appication Program Interface PTG3.0
|
Go to the source code of this file.
Functions | |
| status_t | sdrv_semag_trylock (uint32_t gate_idx) |
| status_t | sdrv_semag_lock (uint32_t gate_idx) |
| status_t | sdrv_semag_unlock (uint32_t gate_idx) |
| int32_t | sdrv_semag_get_lock_proc (uint32_t gate_idx) |
| status_t | sdrv_semag_reset_all_gate (void) |
| status_t | sdrv_semag_enable_gate_notify_interrupt (uint32_t mask) |
| status_t | sdrv_semag_disable_gate_notify_interrupt (uint32_t mask) |
| uint32_t | sdrv_semag_get_notify_status (void) |
| status_t | sdrv_semag_clear_notify_status (uint32_t mask) |
User should initialize mbox module before using semag driver.
| #define SDRV_SEMAG_NUM (32UL) |
| #define SDRV_SEMAG_PROCESSOR_NUM (8UL) |
| status_t sdrv_semag_clear_notify_status | ( | uint32_t | mask | ) |
Clear the gate notification interrupt status.
This function clear SEMAG gate IRQ notifications.
| [in] | mask | Mask of the gate index, for example: (1<<0U) | (1<<1U) means gate 0 and gate 1. |
| status_t sdrv_semag_disable_gate_notify_interrupt | ( | uint32_t | mask | ) |
Disable the gate notification interrupt.
Gate notification provides such feature, when interrupt is enabled, then core tried to lock the gate and failed, it could get notification when the gate is idle.
| [in] | mask | Mask of the gate index, for example: (1<<0U) | (1<<1U) means gate 0 and gate 1. |
| status_t sdrv_semag_enable_gate_notify_interrupt | ( | uint32_t | mask | ) |
Enable the gate notification interrupt.
Gate notification provides such feature, when interrupt is enabled, then core tried to lock the gate and failed, it could get notification when the gate is idle.
| [in] | mask | Mask of the gate index, for example: (1<<0U) | (1<<1U) means gate 0 and gate 1. |
| int32_t sdrv_semag_get_lock_proc | ( | uint32_t | gate_idx | ) |
Gets the status of the SEMAG gate.
This function checks the lock status of a specific SEMAG gate.
| [in] | gate_idx | Gate number to check lock status. |
| uint32_t sdrv_semag_get_notify_status | ( | void | ) |
Get the gate notification flags.
Gate notification provides such feature, when interrupt is enabled, then core tried to lock the gate and failed, it could get notification when the gate is idle.
| status_t sdrv_semag_lock | ( | uint32_t | gate_idx | ) |
Locks the SEMAG gate.
This function locks the specific SEMAG gate. If the gate has been locked by other processors, this function waits until it is unlocked and then lock it.
| [in] | gate_idx | Gate number to lock. |
| status_t sdrv_semag_reset_all_gate | ( | void | ) |
Resets all SEMAG gates to an unlocked status.
This function resets all SEMAG gate to an unlocked status, it will only unlock gates which locked by itself, can't reset gates which locked by other processors.
| status_t sdrv_semag_trylock | ( | uint32_t | gate_idx | ) |
Tries to lock the SEMAG gate.
This function tries to lock the specific SEMAG gate. If the gate has been locked by another processor, this function returns an error code.
| [in] | gate_idx | Gate number to lock. |
| status_t sdrv_semag_unlock | ( | uint32_t | gate_idx | ) |
Unlocks the SEMAG gate.
This function unlocks the specific SEMAG gate. It only writes unlock value to the SEMAG gate register. However, it does not check whether the SEMAG gate is locked by the current processor or not. As a result, if the SEMAG gate is not locked by the current processor, this function has no effect.
| [in] | gate_idx | Gate number to unlock. |