PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
Functions
PDL API Reference » AUTONOMOUS ANALOG (Autonomous Analog Block) » AC (Autonomous Controller)

## General Description

## Functions
cy_en_autanalog_status_t | Cy_AutAnalog_AC_LoadConfig (const cy_stc_autanalog_ac_t *acCfg)
| Configures the AC per provided settings. More...
void | Cy_AutAnalog_StartAutonomousControl (void)
| Enables the AC for operation. More...
uint8_t | Cy_AutAnalog_PauseAutonomousControl (void)
| Pauses the AC during operation. More...
void | Cy_AutAnalog_SingleStepAutonomousControl (void)
| Executes the single-step in the STT. More...
cy_en_autanalog_status_t | Cy_AutAnalog_GetControllerState (cy_stc_autanalog_state_t *ctrlState)
| Provides the operating status of the AC. More...
void | Cy_AutAnalog_OverrideControllerState (uint8_t newState)
| Override current state in the STT with new one. More...
void | Cy_AutAnalog_RunControllerState (uint8_t newState)
| Triggers the AC to override the current state and forces it to run from the STT new state. More...
__STATIC_INLINE bool | Cy_AutAnalog_IsBusy (void)
| Check if the AC is currently executing (RUNNING or STOPPED/PAUSED). More...
void | Cy_AutAnalog_SetOutputTriggerMask (cy_en_autanalog_ac_out_trigger_idx_t trigIdx, cy_en_autanalog_ac_out_trigger_mask_t mask)
| Configures which bits of the mask register generate a trigger output. More...
cy_en_autanalog_ac_out_trigger_mask_t | Cy_AutAnalog_GetOutputTriggerMask (cy_en_autanalog_ac_out_trigger_idx_t trigIdx)
| Returns the AC out trigger mask. More...
void | Cy_AutAnalog_FwTrigger (cy_en_autanalog_fw_trigger_t triggNum)
| Sends a firmware trigger to the AC. More...
cy_en_syspm_status_t | Cy_AutAnalog_DeepSleepCallback (cy_stc_syspm_callback_params_t *callbackParams, cy_en_syspm_callback_mode_t mode)
| Changes the FIFO mode to write only before entering into Deep Sleep mode and restores it to write/read upon wake-up. More...

## Function Documentation

## ◆ Cy_AutAnalog_AC_LoadConfig()

cy_en_autanalog_status_t Cy_AutAnalog_AC_LoadConfig | ( | const cy_stc_autanalog_ac_t * | acCfg | ) |

Configures the AC per provided settings.

Parameters

  acCfg | Pointer to a structure containing configuration data for the AC, cy_stc_autanalog_ac_t.

Returns
  Status of initialization, cy_en_autanalog_status_t.

## ◆ Cy_AutAnalog_StartAutonomousControl()

void Cy_AutAnalog_StartAutonomousControl | ( | void |  | ) |

Enables the AC for operation.

Note
  This function is applicable while the AC is in STOPPED or PAUSED state. See cy_stc_autanalog_state_ac_t for more details. By default, the AC starts running from State 0. The Cy_AutAnalog_OverrideControllerState can be used to overwrite the STT current state.
  The AC will stop whenever the following occurs:
  1. The AC is disabled (Cy_AutAnalog_Disable);
  2. The Autonomous Analog is configured for HS mode (cy_stc_autanalog_state_t::lpModeEnabled is false) and the chip leaves an Active Mode.

## ◆ Cy_AutAnalog_PauseAutonomousControl()

uint8_t Cy_AutAnalog_PauseAutonomousControl | ( | void |  | ) |

Pauses the AC during operation.

The state in the STT does not change.

Note
  This field is used for debug purposes only.

The AC waits for the present state to complete before pausing. If the present state cannot complete (i.e. the ACTION and CONDITION are programmed improperly), the AC will not pause. Do not use this command when executing an AC sleep state (ACTION is set to WAIT_FOR and CONDITION is set to WAKE_*).

When the AC is paused, all AC registered conditions are cleared. This command is ignored if AC is already PAUSED or STOPPED, cy_stc_autanalog_state_t::ac.

Returns
  The current state in the State Transition Table.

## ◆ Cy_AutAnalog_SingleStepAutonomousControl()

void Cy_AutAnalog_SingleStepAutonomousControl | ( | void |  | ) |

Executes the single-step in the STT.

Note
  This field is used for debug purposes only.

If the present state cannot complete (i.e. the ACTION and CONDITION are programmed improperly), the AC will not pause. Do not use this command when executing an AC sleep state (ACTION is set to WAIT_FOR and CONDITION is set to WAKE_*).

When the AC is paused, all AC registered conditions are cleared. This command is ignored if AC is already PAUSED or STOPPED, cy_stc_autanalog_state_t::ac.

## ◆ Cy_AutAnalog_GetControllerState()

cy_en_autanalog_status_t Cy_AutAnalog_GetControllerState | ( | cy_stc_autanalog_state_t * | ctrlState | ) |

Provides the operating status of the AC.

Warning
  If the AC state is RUNNING, the AHB cannot read or write the State Transition Table!

Parameters

  ctrlState | Pointer to a structure for receiving the current operating status.

Returns
  Status of execution, cy_en_autanalog_status_t.

## ◆ Cy_AutAnalog_OverrideControllerState()

void Cy_AutAnalog_OverrideControllerState | ( | uint8_t | newState | ) |

Override current state in the STT with new one.

Note
  This command must never be executed when the AC state is RUNNING, cy_stc_autanalog_state_t::ac.

Parameters

  newState | New state in the State Transition Table.

## ◆ Cy_AutAnalog_RunControllerState()

void Cy_AutAnalog_RunControllerState | ( | uint8_t | newState | ) |

Triggers the AC to override the current state and forces it to run from the STT new state.

Note
  This command must never be executed when the AC state is RUNNING, cy_stc_autanalog_state_t::ac.

Parameters

  newState | Jumping to the new state in the State Transition Table.

## ◆ Cy_AutAnalog_IsBusy()

__STATIC_INLINE bool Cy_AutAnalog_IsBusy | ( | void |  | ) |

Check if the AC is currently executing (RUNNING or STOPPED/PAUSED).

Returns
  Operating status, returns FALSE if STOPPED or PAUSED and TRUE if RUNNING.

## ◆ Cy_AutAnalog_SetOutputTriggerMask()

void Cy_AutAnalog_SetOutputTriggerMask | ( | cy_en_autanalog_ac_out_trigger_idx_t | trigIdx,
|  | cy_en_autanalog_ac_out_trigger_mask_t | mask
| ) |  |

Configures which bits of the mask register generate a trigger output.

Parameters

  trigIdx | The AC trigger register to initialize the out trigger. See cy_en_autanalog_ac_out_trigger_idx_t.
  mask | The mask of triggers allowed to be activated. Each bit of this mask enables the corresponding out trigger in the AC. See cy_en_autanalog_ac_out_trigger_mask_t.

## ◆ Cy_AutAnalog_GetOutputTriggerMask()

cy_en_autanalog_ac_out_trigger_mask_t Cy_AutAnalog_GetOutputTriggerMask | ( | cy_en_autanalog_ac_out_trigger_idx_t | trigIdx | ) |

Returns the AC out trigger mask.

Each bit of this mask enables the corresponding out trigger in the AC.

Parameters

  trigIdx | The AC trigger register to initialize the out trigger. See cy_en_autanalog_ac_out_trigger_idx_t.

Returns
  The mask of triggers allowed to be activated. Each bit of this mask enables the corresponding out trigger in the AC. See cy_en_autanalog_ac_out_trigger_mask_t.

## ◆ Cy_AutAnalog_FwTrigger()

void Cy_AutAnalog_FwTrigger | ( | cy_en_autanalog_fw_trigger_t | triggNum | ) |

Sends a firmware trigger to the AC.

Note
  The AC can be programmed to respond to the firmware trigger by programming a state with a CONDITION TR_LPPASS_IN*. Additionally, this event will force the AC to wake up. Hardware clears this bit when the Autonomous Controller acknowledges the trigger. The firmware trigger is also reset whenever the following occurs:
  1. The AC is disabled (Cy_AutAnalog_Disable);
  2. The Autonomous Analog is configured for HS mode (cy_stc_autanalog_state_t::lpModeEnabled is false) and the chip leaves Active mode.

Parameters

  triggNum | The AC trigger register to initialize the FW trigger. See cy_en_autanalog_fw_trigger_t.

## ◆ Cy_AutAnalog_DeepSleepCallback()

cy_en_syspm_status_t Cy_AutAnalog_DeepSleepCallback | ( | cy_stc_syspm_callback_params_t * | callbackParams,
|  | cy_en_syspm_callback_mode_t | mode
| ) |  |

Changes the FIFO mode to write only before entering into Deep Sleep mode and restores it to write/read upon wake-up.

Note
  Changing the FIFO mode applies only to the AC in LP mode.

Parameters

  callbackParams | Callback parameters, see cy_stc_syspm_callback_params_t
  mode | Callback mode, see cy_en_syspm_callback_mode_t

Returns
  cy_en_syspm_status_t