|
SemiDrive SSDK Appication Program Interface PTG3.0
|
Go to the source code of this file.
Data Structures | |
| struct | mpc_region_cfg |
| struct | mpc_memport_cfg |
| struct | ppc_addrconfig |
| struct | ppc_ipconfig |
| struct | gpio_channel_cfg |
| struct | gpio_core_cfg |
| struct | sdrv_mpc_irqsta_t |
| struct | sdrv_ppc_irqsta_t |
| struct | sdrv_firewall_err_t |
| struct | sdrv_firewall_cfg_t |
| struct | sdrv_firewall |
Functions | |
| status_t | sdrv_firewall_init (sdrv_firewall_t *ctrl, const sdrv_firewall_cfg_t *cfg) |
| status_t | sdrv_firewall_assign_domain (sdrv_firewall_t *ctrl, uint8_t master_id, uint8_t domain_id) |
| status_t | sdrv_firewall_lock_domain_assignment (sdrv_firewall_t *ctrl) |
| status_t | sdrv_firewall_set_callback (sdrv_firewall_t *ctrl, sdrv_firewall_callback_t callback, void *userdata) |
| int | sdrv_firewall_irq_handler (uint32_t irq, void *ctrl) |
| status_t | sdrv_firewall_get_error_info (sdrv_firewall_t *ctrl, sdrv_firewall_err_t *firewall_err_info) |
SEMIDRIVE Copyright Statement Copyright (c) SEMIDRIVE. All rights reserved
This software and all rights therein are owned by SEMIDRIVE, and are protected by copyright law and other relevant laws, regulations and protection. Without SEMIDRIVE's prior written consent and/or related rights, please do not use this software or any potion thereof in any form or by any means. You may not reproduce, modify or distribute this software except in compliance with the License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' basis, WITHOUT WARRANTIES OF ANY KIND, either express or implied.
| Date | Version |
|---|---|
| 2023/11/29 | 1.0.0 |
| #define FIREWALL_APB_MAC_BASE APB_MAC_BASE |
Firewall module base address.
| #define FIREWALL_INIT (0x01U) |
Firewall module initialized state.
| #define FIREWALL_PERMISSION_NONE (0x03U) |
No permission.
| #define FIREWALL_PERMISSION_RO (0x01U) |
Enable read permission.
| #define FIREWALL_PERMISSION_RW (0x00U) |
Enable read and write permissions.
| #define FIREWALL_PERMISSION_WO (0x02U) |
Enable write permission.
| #define FIREWALL_REG_VALUE_MAX (0xFFFFFFFFU) |
The maximum value of register.
| #define FIREWALL_REG_VALUE_MIN (0x00U) |
The minimum value of register.
| #define FIREWALL_UNINIT (0x00U) |
Firewall module uninitialized state.
| typedef void(* sdrv_firewall_callback_t) (sdrv_firewall_t *ctrl, void *userdata) |
Firewall callback function type.
| typedef enum sdrv_firewall_err_status sdrv_firewall_err_status_e |
Firewall status return code.
| typedef struct sdrv_firewall sdrv_firewall_t |
| typedef struct gpio_channel_cfg sdrv_gpio_channel_cfg_t |
Pin configuration.
| typedef struct gpio_core_cfg sdrv_gpio_core_cfg_t |
Pin permission for the core.
| typedef const uint8_t* sdrv_mac_config_t |
The type of configuarion for the MAC module.
| typedef struct mpc_memport_cfg sdrv_mpc_memport_cfg_t |
MPC memory port configure.
| typedef struct mpc_region_cfg sdrv_mpc_region_cfg_t |
MPC region configure.
| typedef struct ppc_ipconfig sdrv_ppc_ip_config_t |
PPC ip configure.
| typedef struct ppc_addrconfig sdrv_ppc_region_config_t |
PPC address configure.
Firewall status return code.
| status_t sdrv_firewall_assign_domain | ( | sdrv_firewall_t * | ctrl, |
| uint8_t | master_id, | ||
| uint8_t | domain_id | ||
| ) |
Assigns the master to the specified domain.
Assigns the specified master to a domain. This function should be executed after the initialization function sdrv_firewall_init().
| [in] | ctrl | the firewall instance. |
| [in] | master_id | the id of the master. |
| [in] | domain_id | the id of the domain. |
return FIREWALL_E_UNINIT: The firewall is uninitialized.
| status_t sdrv_firewall_get_error_info | ( | sdrv_firewall_t * | ctrl, |
| sdrv_firewall_err_t * | firewall_err_info | ||
| ) |
Get firewall illegal access infomation.
Should enable the macro FIREWALL_INTERRUPT_EN.
| [in] | ctrl | the firewall instance. |
| [in] | firewall_err_info | Pointer to the buffer used by system to get the information. |
return FIREWALL_E_NULL_POINTER : The pointer to the MAC configuration is NULL.
| status_t sdrv_firewall_init | ( | sdrv_firewall_t * | ctrl, |
| const sdrv_firewall_cfg_t * | cfg | ||
| ) |
Configure firewall.
| [in] | ctrl | the firewall instance. |
| [in] | cfg | the configuration of the MAC/MPC/PPC/GPIO module. |
return SDRV_STATUS_INVALID_PARAM, invalid configuration parameter.
| int sdrv_firewall_irq_handler | ( | uint32_t | irq, |
| void * | ctrl | ||
| ) |
Handle firewall interrupt.
This function clear MAC/PPC/MPC Interruption, return interrupt state.
| [in] | irq | the irq number of the firewall. |
| [in] | ctrl | sdrv firewall controller. |
return 1 : The pointer to the MAC configuration is NULL.
| status_t sdrv_firewall_lock_domain_assignment | ( | sdrv_firewall_t * | ctrl | ) |
Lock the domain assignment of the master.
This function lock the domain assignment of the master, should be called after the initialization function sdrv_firewall_init() or domain assignment function sdrv_firewall_assign_domain().
| [in] | ctrl | the firewall instance. |
return FIREWALL_E_INIT : The firewall is uninitialized.
| status_t sdrv_firewall_set_callback | ( | sdrv_firewall_t * | ctrl, |
| sdrv_firewall_callback_t | callback, | ||
| void * | userdata | ||
| ) |
Set callback function for firewall.
| [in] | ctrl | the firewall instance. |
| [in] | callback | the callback function. |
| [in] | userdata | the param of callback function. |
return FIREWALL_E_NULL_POINTER : The pointer to the MAC configuration is NULL.