Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
osdp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Siddharth Chandrasekaran <siddharth@embedjournal.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef _OSDP_H_
8#define _OSDP_H_
9
10#include <zephyr.h>
11#include <stdint.h>
12
13#include <sys/slist.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#define OSDP_CMD_TEXT_MAX_LEN 32
20#define OSDP_CMD_KEYSET_KEY_MAX_LEN 32
21
31};
32
51};
52
63};
64
90};
91
105};
106
122};
123
147};
148
160};
161
174};
175
188
201struct osdp_cmd {
204 union {
211 };
212};
213
214#ifdef CONFIG_OSDP_MODE_PD
215
222int osdp_pd_get_cmd(struct osdp_cmd *cmd);
223
224#else /* CONFIG_OSDP_MODE_PD */
225
227 int (*cb)(int address, uint8_t key));
229 int (*cb)(int address, int format, uint8_t *data, int len));
230int osdp_cp_send_command(int pd, struct osdp_cmd *cmd);
231
232#endif /* CONFIG_OSDP_MODE_PD */
233
234#ifdef CONFIG_OSDP_SC_ENABLED
235
236uint32_t osdp_get_sc_status_mask(void);
237
238#endif
239
240#ifdef __cplusplus
241}
242#endif
243
244#endif /* _OSDP_H_ */
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition: ft8xx_reference_api.h:153
#define OSDP_CMD_KEYSET_KEY_MAX_LEN
Definition: osdp.h:20
osdp_card_formats_e
Various card formats that a PD can support. This is sent to CP when a PD must report a card read.
Definition: osdp.h:26
@ OSDP_CARD_FMT_ASCII
Definition: osdp.h:29
@ OSDP_CARD_FMT_SENTINEL
Definition: osdp.h:30
@ OSDP_CARD_FMT_RAW_UNSPECIFIED
Definition: osdp.h:27
@ OSDP_CARD_FMT_RAW_WIEGAND
Definition: osdp.h:28
int osdp_cp_set_callback_card_read(int(*cb)(int address, int format, uint8_t *data, int len))
osdp_led_color_e
LED Colors as specified in OSDP for the on_color/off_color parameters.
Definition: osdp.h:56
@ OSDP_LED_COLOR_SENTINEL
Definition: osdp.h:62
@ OSDP_LED_COLOR_RED
Definition: osdp.h:58
@ OSDP_LED_COLOR_NONE
Definition: osdp.h:57
@ OSDP_LED_COLOR_GREEN
Definition: osdp.h:59
@ OSDP_LED_COLOR_BLUE
Definition: osdp.h:61
@ OSDP_LED_COLOR_AMBER
Definition: osdp.h:60
osdp_cmd_e
OSDP application exposed commands.
Definition: osdp.h:179
@ OSDP_CMD_COMSET
Definition: osdp.h:185
@ OSDP_CMD_KEYSET
Definition: osdp.h:184
@ OSDP_CMD_LED
Definition: osdp.h:181
@ OSDP_CMD_SENTINEL
Definition: osdp.h:186
@ OSDP_CMD_BUZZER
Definition: osdp.h:182
@ OSDP_CMD_OUTPUT
Definition: osdp.h:180
@ OSDP_CMD_TEXT
Definition: osdp.h:183
#define OSDP_CMD_TEXT_MAX_LEN
Definition: osdp.h:19
int osdp_cp_set_callback_key_press(int(*cb)(int address, uint8_t key))
int osdp_cp_send_command(int pd, struct osdp_cmd *cmd)
Single-linked list implementation.
struct _snode sys_snode_t
Definition: slist.h:33
static k_spinlock_key_t key
Definition: spinlock_error_case.c:14
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
Sent from CP to control the behaviour of a buzzer in the PD.
Definition: osdp.h:116
uint8_t reader
Definition: osdp.h:117
uint8_t rep_count
Definition: osdp.h:121
uint8_t control_code
Definition: osdp.h:118
uint8_t on_count
Definition: osdp.h:119
uint8_t off_count
Definition: osdp.h:120
Sent in response to a COMSET command. Set communication parameters to PD. Must be stored in PD non-vo...
Definition: osdp.h:157
uint32_t baud_rate
Definition: osdp.h:159
uint8_t address
Definition: osdp.h:158
This command transfers an encryption key from the CP to a PD.
Definition: osdp.h:170
uint8_t length
Definition: osdp.h:172
uint8_t type
Definition: osdp.h:171
uint8_t data[32]
Definition: osdp.h:173
LED params sub-structure. Part of LED command. See struct osdp_cmd_led.
Definition: osdp.h:83
uint16_t timer_count
Definition: osdp.h:89
uint8_t off_count
Definition: osdp.h:86
uint8_t on_color
Definition: osdp.h:87
uint8_t off_color
Definition: osdp.h:88
uint8_t on_count
Definition: osdp.h:85
uint8_t control_code
Definition: osdp.h:84
Sent from CP to PD to control the behaviour of it's on-board LEDs.
Definition: osdp.h:100
struct osdp_cmd_led_params permanent
Definition: osdp.h:104
struct osdp_cmd_led_params temporary
Definition: osdp.h:103
uint8_t led_number
Definition: osdp.h:102
uint8_t reader
Definition: osdp.h:101
Command sent from CP to Control digital output of PD.
Definition: osdp.h:47
uint8_t control_code
Definition: osdp.h:49
uint16_t timer_count
Definition: osdp.h:50
uint8_t output_no
Definition: osdp.h:48
Command to manuplate any display units that the PD supports.
Definition: osdp.h:139
uint8_t offset_row
Definition: osdp.h:143
uint8_t data[32]
Definition: osdp.h:146
uint8_t reader
Definition: osdp.h:140
uint8_t control_code
Definition: osdp.h:141
uint8_t length
Definition: osdp.h:145
uint8_t offset_col
Definition: osdp.h:144
uint8_t temp_time
Definition: osdp.h:142
OSDP Command Structure. This is a wrapper for all individual OSDP commands.
Definition: osdp.h:201
enum osdp_cmd_e id
Definition: osdp.h:203
struct osdp_cmd_comset comset
Definition: osdp.h:209
struct osdp_cmd_buzzer buzzer
Definition: osdp.h:206
struct osdp_cmd_text text
Definition: osdp.h:207
sys_snode_t node
Definition: osdp.h:202
struct osdp_cmd_output output
Definition: osdp.h:208
struct osdp_cmd_led led
Definition: osdp.h:205
struct osdp_cmd_keyset keyset
Definition: osdp.h:210
static fdata_t data[2]
Definition: test_fifo_contexts.c:15