14 #include <xcore/port.h>
16 #include "rtos_osal.h"
17 #include "rtos_driver_rpc.h"
25 rtos_gpio_port_none = -1,
65 #define RTOS_GPIO_ISR_CALLBACK_ATTR __attribute__((fptrgroup("rtos_gpio_isr_cb_fptr_grp")))
108 chanend_t rpc_interrupt_c[RTOS_DRIVER_RPC_MAX_CLIENT_TILES];
110 __attribute__((fptrgroup(
"rtos_gpio_port_enable_fptr_grp")))
113 __attribute__((fptrgroup(
"rtos_gpio_port_in_fptr_grp")))
116 __attribute__((fptrgroup(
"rtos_gpio_port_out_fptr_grp")))
119 __attribute__((fptrgroup(
"rtos_gpio_port_write_control_word_fptr_grp")))
122 __attribute__((fptrgroup(
"rtos_gpio_isr_callback_set_fptr_grp")))
125 __attribute__((fptrgroup(
"rtos_gpio_interrupt_enable_fptr_grp")))
128 __attribute__((fptrgroup(
"rtos_gpio_interrupt_disable_fptr_grp")))
133 rtos_osal_mutex_t lock;
136 #include "rtos_gpio_rpc.h"
150 return rtos_gpio_port_1A;
152 return rtos_gpio_port_1B;
154 return rtos_gpio_port_1C;
156 return rtos_gpio_port_1D;
158 return rtos_gpio_port_1E;
160 return rtos_gpio_port_1F;
162 return rtos_gpio_port_1G;
164 return rtos_gpio_port_1H;
166 return rtos_gpio_port_1I;
168 return rtos_gpio_port_1J;
170 return rtos_gpio_port_1K;
172 return rtos_gpio_port_1L;
174 return rtos_gpio_port_1M;
176 return rtos_gpio_port_1N;
178 return rtos_gpio_port_1O;
180 return rtos_gpio_port_1P;
182 return rtos_gpio_port_4A;
184 return rtos_gpio_port_4B;
186 return rtos_gpio_port_4C;
188 return rtos_gpio_port_4D;
190 return rtos_gpio_port_4E;
192 return rtos_gpio_port_4F;
194 return rtos_gpio_port_8A;
196 return rtos_gpio_port_8B;
198 return rtos_gpio_port_8C;
200 return rtos_gpio_port_8D;
202 return rtos_gpio_port_16A;
204 return rtos_gpio_port_16B;
206 return rtos_gpio_port_16C;
208 return rtos_gpio_port_16D;
210 return rtos_gpio_port_32A;
212 return rtos_gpio_port_32B;
214 return rtos_gpio_port_none;
238 ctx->port_enable(ctx, port_id);
253 return ctx->port_in(ctx, port_id);
268 ctx->port_out(ctx, port_id, value);
292 ctx->isr_callback_set(ctx, port_id, cb, app_data);
306 ctx->interrupt_enable(ctx, port_id);
319 ctx->interrupt_disable(ctx, port_id);
335 return ctx->port_write_control_word(ctx, port_id, XS1_SETC_DRIVE_DRIVE);
350 return ctx->port_write_control_word(ctx, port_id, XS1_SETC_DRIVE_PULL_UP);
365 return ctx->port_write_control_word(ctx, port_id, XS1_SETC_DRIVE_PULL_DOWN);
378 return ctx->port_write_control_word(ctx, port_id, XS1_SETC_DRIVE_DRIVE);
391 return ctx->port_write_control_word(ctx, port_id, XS1_SETC_DRIVE_PULL_UP);
404 return ctx->port_write_control_word(ctx, port_id, XS1_SETC_DRIVE_PULL_DOWN);
419 return ctx->port_write_control_word(ctx, port_id, value);
void rtos_gpio_port_pull_down(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:400
void rtos_gpio_write_control_word(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id, uint32_t value)
Definition: rtos_gpio.h:414
uint32_t rtos_gpio_port_in(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:249
void rtos_gpio_port_pull_none(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:374
void rtos_gpio_port_enable(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:234
void rtos_gpio_interrupt_enable(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:302
void rtos_gpio_port_out(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id, uint32_t value)
Definition: rtos_gpio.h:263
void rtos_gpio_port_drive_low(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:346
void rtos_gpio_interrupt_disable(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:315
void rtos_gpio_port_drive(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:331
void rtos_gpio_port_pull_up(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:387
void rtos_gpio_isr_callback_set(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id, rtos_gpio_isr_cb_t cb, void *app_data)
Definition: rtos_gpio.h:286
void rtos_gpio_port_drive_high(rtos_gpio_t *ctx, rtos_gpio_port_id_t port_id)
Definition: rtos_gpio.h:361
rtos_gpio_port_id_t
Definition: rtos_gpio.h:24
void rtos_gpio_init(rtos_gpio_t *ctx)
Definition: rtos_gpio.c:178
void rtos_gpio_start(rtos_gpio_t *ctx)
Definition: rtos_gpio.c:170
#define RTOS_GPIO_ISR_CALLBACK_ATTR
Definition: rtos_gpio.h:65
void(* rtos_gpio_isr_cb_t)(rtos_gpio_t *ctx, void *app_data, rtos_gpio_port_id_t port_id, uint32_t value)
Definition: rtos_gpio.h:86
rtos_gpio_port_id_t rtos_gpio_port(port_t p)
Definition: rtos_gpio.h:146
@ RTOS_GPIO_TOTAL_PORT_CNT
Definition: rtos_gpio.h:58
Definition: rtos_driver_rpc.h:23
Definition: rtos_gpio.h:93
Definition: rtos_gpio.h:106