Home | History | Annotate | Download | only in pn80t

Lines Matching refs:ese

19 #include "include/ese/hw/nxp/pn80t/common.h"
53 int nxp_pn80t_open(struct EseInterface *ese, void *board) {
56 _static_assert(sizeof(ese->pad) >= sizeof(struct NxpState *),
58 platform = ese->ops->opts;
64 ese_set_error(ese, kNxpPn80tErrorPlatformInit);
68 ns = NXP_PN80T_STATE(ese);
69 TEQ1_INIT_CARD_STATE((struct Teq1CardState *)(&ese->pad[0]));
73 ese_set_error(ese, kNxpPn80tErrorPlatformInit);
88 /* Power on eSE */
94 uint32_t nxp_pn80t_send_cooldown(struct EseInterface *ese, bool end);
96 int nxp_pn80t_reset(struct EseInterface *ese) {
97 const struct Pn80tPlatform *platform = ese->ops->opts;
98 struct NxpState *ns = NXP_PN80T_STATE(ese);
107 if (!ese_error(ese)) {
108 const uint32_t cooldownSec = nxp_pn80t_send_cooldown(ese, false);
109 if (!ese_error(ese) && cooldownSec > 0) {
115 ese_set_error(ese, kNxpPn80tErrorResetToggle);
119 ese_set_error(ese, kNxpPn80tErrorResetToggle);
124 ese->error.is_err = false;
128 int nxp_pn80t_poll(struct EseInterface *ese, uint8_t poll_for, float timeout,
130 struct NxpState *ns = NXP_PN80T_STATE(ese);
131 const struct Pn80tPlatform *platform = ese->ops->opts;
144 if (ese->ops->hw_receive(ese, &byte, 1, complete) != 1) {
146 ese_set_error(ese, kNxpPn80tErrorPollRead);
176 uint32_t nxp_pn80t_send_cooldown(struct EseInterface *ese, bool end) {
177 struct NxpState *ns = NXP_PN80T_STATE(ese);
178 const struct Pn80tPlatform *platform = ese->ops->opts;
185 if (ese_error(ese)) {
189 ese->ops->hw_transmit(ese, message, message_len, 1);
190 if (ese_error(ese)) {
195 nxp_pn80t_poll(ese, kTeq1Options.host_address, 5.0f, 0);
196 if (ese_error(ese)) {
202 ese->ops->hw_receive(ese, rx_buf, sizeof(rx_buf), 1);
203 if (ese_error(ese)) {
231 /* Wait 25ms Guard time to make sure eSE is in DPD mode */
246 uint32_t nxp_pn80t_handle_interface_call(struct EseInterface *ese,
252 const struct Pn80tPlatform *platform = ese->ops->opts;
259 struct NxpState *ns = NXP_PN80T_STATE(ese);
272 ese_set_error(ese, 0);
273 if (nxp_pn80t_reset(ese) < 0) {
296 const uint32_t cooldownSec = nxp_pn80t_send_cooldown(ese, false);
298 if (ese_error(ese)) {
299 /* Return SW_UKNOWN on an ese failure. */
307 uint32_t nxp_pn80t_transceive(struct EseInterface *ese,
312 nxp_pn80t_handle_interface_call(ese, tx_buf, tx_len, rx_buf, rx_len);
316 return teq1_transceive(ese, &kTeq1Options, tx_buf, tx_len, rx_buf, rx_len);
319 void nxp_pn80t_close(struct EseInterface *ese) {
321 struct NxpState *ns = NXP_PN80T_STATE(ese);
322 const struct Pn80tPlatform *platform = ese->ops->opts;
323 const uint32_t wait_sec = nxp_pn80t_send_cooldown(ese, true);
329 if (ese_error(ese) || wait_sec == 0) {