Infineon platform abstraction APIs. More...
Data Structures | |
struct | pal_gpio |
Structure defines the PAL GPIO configuration. More... | |
struct | pal_i2c |
PAL I2C context structure. More... | |
Macros | |
#define | PAL_STATUS_SUCCESS (0x0000) |
PAL API execution is successful. | |
#define | PAL_STATUS_FAILURE (0x0001) |
PAL API execution failed. | |
#define | PAL_STATUS_I2C_BUSY (0x0002) |
PAL I2C is busy. | |
#define | PAL_I2C_EVENT_SUCCESS (0x0000) |
Event returned when I2C master completes execution. | |
#define | PAL_I2C_EVENT_ERROR (0x0001) |
Event returned when I2C master operation fails. | |
#define | PAL_I2C_EVENT_BUSY (0x0002) |
Event returned when lower level I2C bus is busy. | |
Typedefs | |
typedef uint16_t | pal_status_t |
PAL return status. | |
typedef struct pal_gpio | pal_gpio_t |
Structure defines the PAL GPIO configuration. | |
typedef struct pal_i2c | pal_i2c_t |
PAL I2C context structure. | |
typedef void(* | register_callback )(void *) |
typedef for Callback function when timer elapses. | |
Functions | |
void | pal_gpio_set_high (const pal_gpio_t *p_gpio_context) |
void | pal_gpio_set_low (const pal_gpio_t *p_gpio_context) |
pal_status_t | pal_i2c_init (const pal_i2c_t *p_i2c_context) |
pal_status_t | pal_i2c_set_bitrate (const pal_i2c_t *p_i2c_context, uint16_t bitrate) |
pal_status_t | pal_i2c_write (pal_i2c_t *p_i2c_context, uint8_t *p_data, uint16_t length) |
pal_status_t | pal_i2c_read (pal_i2c_t *p_i2c_context, uint8_t *p_data, uint16_t length) |
pal_status_t | pal_i2c_deinit (const pal_i2c_t *p_i2c_context) |
void | pal_os_event_register_callback_oneshot (register_callback callback, void *callback_args, uint32_t time_us) |
pal_status_t | pal_os_lock_acquire (void) |
Acquires a lock. More... | |
void | pal_os_lock_release (void) |
Releases the lock. More... | |
uint32_t | pal_os_random_get_counter (void) |
Gets the random counter value. | |
uint32_t | pal_os_timer_get_time_in_milliseconds (void) |
Gets tick count value in milliseconds. More... | |
void | pal_os_timer_delay_in_milliseconds (uint16_t milliseconds) |
Waits or delay until the supplied milliseconds. More... | |
Variables | |
pal_i2c_t | optiga_pal_i2c_context_0 |
pal_gpio_t | optiga_vdd_0 |
pal_gpio_t | optiga_reset_0 |
Infineon platform abstraction APIs.
void pal_gpio_set_high | ( | const pal_gpio_t * | p_gpio_context | ) |
Sets the gpio pin to high state
API Details: The API sets the pin high, only if the pin is assigned to a valid gpio context.
Otherwise the API returns without any failure status.
[in] | p_gpio_context | Pointer to pal layer gpio context |
void pal_gpio_set_low | ( | const pal_gpio_t * | p_gpio_context | ) |
Sets the gpio pin to low state
API Details: The API set the pin low, only if the pin is assigned to a valid gpio context.
Otherwise the API returns without any failure status.
[in] | p_gpio_context | Pointer to pal layer gpio context |
pal_status_t pal_i2c_deinit | ( | const pal_i2c_t * | p_i2c_context | ) |
API to de-initialize the I2C master with the specified context.
API Details:
User Input:
[in] | p_i2c_context | I2C context to be de-initialized |
PAL_STATUS_SUCCESS | Returns when the I2C master de-init it successfull |
PAL_STATUS_FAILURE | Returns when the I2C de-init fails. |
pal_status_t pal_i2c_init | ( | const pal_i2c_t * | p_i2c_context | ) |
API to initialize the i2c master with the given context.
API Details:
User Input:
[in] | p_i2c_context | Pal i2c context to be initialized |
PAL_STATUS_SUCCESS | Returns when the I2C master init it successfull |
PAL_STATUS_FAILURE | Returns when the I2C init fails. |
pal_status_t pal_i2c_read | ( | pal_i2c_t * | p_i2c_context, |
uint8_t * | p_data, | ||
uint16_t | length | ||
) |
Platform abstraction layer API to read the data from I2C slave.
API Details:
User Input:
Notes:
[in] | p_i2c_context | pointer to the PAL i2c context pal_i2c_t |
[in] | p_data | Pointer to the data buffer to store the read data |
[in] | length | Length of the data to be read |
PAL_STATUS_SUCCESS | Returns when the I2C read is invoked successfully |
PAL_STATUS_FAILURE | Returns when the I2C read fails. |
PAL_STATUS_I2C_BUSY | Returns when the I2C bus is busy. |
pal_status_t pal_i2c_set_bitrate | ( | const pal_i2c_t * | p_i2c_context, |
uint16_t | bitrate | ||
) |
Platform abstraction layer API to set the bitrate/speed(KHz) of I2C master.
API Details:
User Input:
[in] | p_i2c_context | Pointer to the pal i2c context |
[in] | bitrate | Bitrate in KHz |
PAL_STATUS_SUCCESS | Returns when the setting of bitrate is successfully completed |
PAL_STATUS_FAILURE | Returns when the setting of bitrate fails. |
PAL_STATUS_I2C_BUSY | Returns when the I2C bus is busy. |
pal_status_t pal_i2c_write | ( | pal_i2c_t * | p_i2c_context, |
uint8_t * | p_data, | ||
uint16_t | length | ||
) |
Platform abstraction layer API to write the data to I2C slave.
API Details:
User Input:
Notes:
[in] | p_i2c_context | Pointer to the pal I2C context pal_i2c_t |
[in] | p_data | Pointer to the data to be written |
[in] | length | Length of the data to be written |
PAL_STATUS_SUCCESS | Returns when the I2C write is invoked successfully |
PAL_STATUS_FAILURE | Returns when the I2C write fails. |
PAL_STATUS_I2C_BUSY | Returns when the I2C bus is busy. |
void pal_os_event_register_callback_oneshot | ( | register_callback | callback, |
void * | callback_args, | ||
uint32_t | time_us | ||
) |
Platform specific event call back registration function to trigger once when timer expires.
API Details: This function registers the callback function supplied by the caller.
It triggers a timer with the supplied time interval in microseconds.
Once the timer expires, the registered callback function gets called.
[in] | callback | Callback function pointer |
[in] | callback_args | Callback arguments |
[in] | time_us | time in micro seconds to trigger the call back |
pal_status_t pal_os_lock_acquire | ( | void | ) |
Acquires a lock.
Pre-conditions: None.
API Details:
void pal_os_lock_release | ( | void | ) |
Releases the lock.
Pre-conditions: None.
API Details:
void pal_os_timer_delay_in_milliseconds | ( | uint16_t | milliseconds | ) |
Waits or delay until the supplied milliseconds.
[in] | milliseconds | Delay value in milliseconds |
uint32_t pal_os_timer_get_time_in_milliseconds | ( | void | ) |
Gets tick count value in milliseconds.
uint32_t | time in milliseconds |