#include <zephyr/kernel.h>#include <zephyr/device.h>Go to the source code of this file.
Classes | |
| struct | m6e_nano_api |
| struct | m6e_nano_buf |
| struct | m6e_nano_data |
| struct | m6e_nano_config |
Typedefs | |
| typedef int(* | m6e_nano_send_command_t) (const struct device *dev, uint8_t *command, const uint8_t length, bool timeout) |
| typedef void(* | m6e_nano_callback_t) (const struct device *dev, void *user_data) |
| typedef void(* | m6e_nano_set_callback_t) (const struct device *dev, m6e_nano_callback_t callback, void *user_data) |
Functions | |
| int | user_send_command (const struct device *dev, uint8_t *command, const uint8_t length, const bool timeout) |
| Set the command to be transmitted by the UART peripheral. | |
| uint8_t | m6e_nano_get_tag_epc_bytes (const struct device *dev) |
| Retrieve the number of bytes from EPC. | |
| uint8_t | m6e_nano_get_tag_rssi (const struct device *dev) |
| Retrieve the RSSI of the tag. | |
| uint16_t | m6e_nano_get_tag_timestamp (const struct device *dev) |
| Retrieve the timestamp of the tag. | |
| uint32_t | m6e_nano_get_tag_freq (const struct device *dev) |
| Retrieve the frequency of the tag. | |
| void | m6e_nano_disable_read_filter (const struct device *dev) |
| Disable the read filter. | |
| void | m6e_nano_stop_reading (const struct device *dev) |
| Stop a continuous read operation. | |
| void | m6e_nano_set_power_mode (const struct device *dev, uint8_t mode) |
| Set the power mode of the M6E Nano. | |
| void | m6e_nano_set_antenna_port (const struct device *dev) |
| Set the antenna port of the M6E Nano. | |
| void | m6e_nano_set_read_power (const struct device *dev, uint16_t power) |
| Set the read power of the M6E Nano. | |
| void | m6e_nano_start_reading (const struct device *dev) |
| Start a continuous read operation. | |
| void | m6e_nano_set_region (const struct device *dev, uint8_t region) |
| Set the operating region of the M6E Nano. This controls the transmission frequency of the RFID reader. | |
| int | m6e_nano_get_version (const struct device *dev) |
| Retrieve the firmware version of the M6E Nano. | |
| void | m6e_nano_set_tag_protocol (const struct device *dev, uint8_t protocol) |
| Set the tag protocol of the M6E Nano. | |
| void | m6e_nano_get_write_power (const struct device *dev) |
| Retrieve the write power of the M6E Nano. | |
| void | m6e_nano_set_baud (const struct device *dev, long baud_rate) |
| Set the baudrate of the M6E Nano. | |
| void | m6e_nano_send_generic_command (const struct device *dev, uint8_t *command, uint8_t size, uint8_t opcode) |
| Send a generic command to the M6E Nano. | |
| uint8_t | m6e_nano_parse_response (const struct device *dev) |
| Parse the tag response from the M6E Nano. | |
| #define CFG_M6E_NANO_SERIAL_TIMEOUT 1000 |
| #define COMMAND_TIME_OUT 2000 |
| #define ERROR_COMMAND_RESPONSE_TIMEOUT 1 |
| #define ERROR_CORRUPT_RESPONSE 2 |
| #define ERROR_UNKNOWN_OPCODE 4 |
| #define ERROR_WRONG_OPCODE_RESPONSE 3 |
| #define M6E_NANO_BUF_SIZE 255 |
| #define M6E_NANO_MAX_TAGS 150 |
| #define REGION_AUSTRALIA 0x0B |
| #define REGION_CHINA 0x06 |
| #define REGION_EUROPE 0x08 |
| #define REGION_INDIA 0x04 |
| #define REGION_JAPAN 0x05 |
| #define REGION_KOREA 0x09 |
| #define REGION_NEWZEALAND 0x0C |
| #define REGION_NORTHAMERICA 0x0D |
| #define REGION_OPEN 0xFF |
| #define RESPONSE_CLEAR 13 |
| #define RESPONSE_FAIL 12 |
| #define RESPONSE_IS_KEEPALIVE 6 |
| #define RESPONSE_IS_NOTAGFOUND 9 |
| #define RESPONSE_IS_TAGFOUND 8 |
| #define RESPONSE_IS_TEMPERATURE 5 |
| #define RESPONSE_IS_TEMPTHROTTLE 7 |
| #define RESPONSE_IS_UNKNOWN 10 |
| #define RESPONSE_PENDING 0 |
| #define RESPONSE_STARTUP 14 |
| #define RESPONSE_SUCCESS 11 |
| #define TMR_SR_OPCODE_CLEAR_TAG_ID_BUFFER 0x2A |
| #define TMR_SR_OPCODE_GET_POWER_MODE 0x68 |
| #define TMR_SR_OPCODE_GET_PROTOCOL_PARAM 0x6B |
| #define TMR_SR_OPCODE_GET_READ_TX_POWER 0x62 |
| #define TMR_SR_OPCODE_GET_READER_OPTIONAL_PARAMS 0x6A |
| #define TMR_SR_OPCODE_GET_USER_GPIO_INPUTS 0x66 |
| #define TMR_SR_OPCODE_GET_WRITE_TX_POWER 0x64 |
| #define TMR_SR_OPCODE_KILL_TAG 0x26 |
| #define TMR_SR_OPCODE_MULTI_PROTOCOL_TAG_OP 0x2F |
| #define TMR_SR_OPCODE_READ_TAG_DATA 0x28 |
| #define TMR_SR_OPCODE_READ_TAG_ID_MULTIPLE 0x22 |
| #define TMR_SR_OPCODE_READ_TAG_ID_SINGLE 0x21 |
| #define TMR_SR_OPCODE_SET_ANTENNA_PORT 0x91 |
| #define TMR_SR_OPCODE_SET_BAUD_RATE 0x06 |
| #define TMR_SR_OPCODE_SET_POWER_MODE 0x98 |
| #define TMR_SR_OPCODE_SET_PROTOCOL_PARAM 0x9B |
| #define TMR_SR_OPCODE_SET_READ_TX_POWER 0x92 |
| #define TMR_SR_OPCODE_SET_READER_OPTIONAL_PARAMS 0x9A |
| #define TMR_SR_OPCODE_SET_REGION 0x97 |
| #define TMR_SR_OPCODE_SET_TAG_PROTOCOL 0x93 |
| #define TMR_SR_OPCODE_SET_USER_GPIO_OUTPUTS 0x96 |
| #define TMR_SR_OPCODE_SET_WRITE_TX_POWER 0x94 |
| #define TMR_SR_OPCODE_VERSION 0x03 |
| #define TMR_SR_OPCODE_VERSION_STARTUP 0x04 |
| #define TMR_SR_OPCODE_WRITE_TAG_DATA 0x24 |
| #define TMR_SR_OPCODE_WRITE_TAG_ID 0x23 |
| #define TMR_SR_POWER_MODE_FULL 0x00 |
| #define TMR_SR_POWER_MODE_MAX_SAVE 0x03 |
| #define TMR_SR_POWER_MODE_MED_SAVE 0x02 |
| #define TMR_SR_POWER_MODE_MIN_SAVE 0x01 |
| #define TMR_START_HEADER 0xFF |
| #define TMR_TAG_PROTOCOL_ATA 0x1D |
| #define TMR_TAG_PROTOCOL_GEN2 0x05 |
| #define TMR_TAG_PROTOCOL_IPX256 0x08 |
| #define TMR_TAG_PROTOCOL_IPX64 0x07 |
| #define TMR_TAG_PROTOCOL_ISO180006B 0x03 |
| #define TMR_TAG_PROTOCOL_ISO180006B_UCODE 0x06 |
| #define TMR_TAG_PROTOCOL_NONE 0x00 |
| typedef void(* m6e_nano_callback_t) (const struct device *dev, void *user_data) |
| typedef int(* m6e_nano_send_command_t) (const struct device *dev, uint8_t *command, const uint8_t length, bool timeout) |
| typedef void(* m6e_nano_set_callback_t) (const struct device *dev, m6e_nano_callback_t callback, void *user_data) |
| void m6e_nano_disable_read_filter | ( | const struct device * | dev | ) |
Disable the read filter.
| dev | UART peripheral device. |
| uint8_t m6e_nano_get_tag_epc_bytes | ( | const struct device * | dev | ) |
Retrieve the number of bytes from EPC.
| dev | UART peripheral device. |
| uint32_t m6e_nano_get_tag_freq | ( | const struct device * | dev | ) |
Retrieve the frequency of the tag.
| dev | UART peripheral device. |
| uint8_t m6e_nano_get_tag_rssi | ( | const struct device * | dev | ) |
Retrieve the RSSI of the tag.
| dev | UART peripheral device. |
| uint16_t m6e_nano_get_tag_timestamp | ( | const struct device * | dev | ) |
Retrieve the timestamp of the tag.
| dev | UART peripheral device. |
| int m6e_nano_get_version | ( | const struct device * | dev | ) |
Retrieve the firmware version of the M6E Nano.
| dev | UART peripheral device. |
| void m6e_nano_get_write_power | ( | const struct device * | dev | ) |
Retrieve the write power of the M6E Nano.
| dev | UART peripheral device. |
| uint8_t m6e_nano_parse_response | ( | const struct device * | dev | ) |
Parse the tag response from the M6E Nano.
| dev | UART peripheral device. |
| void m6e_nano_send_generic_command | ( | const struct device * | dev, |
| uint8_t * | command, | ||
| uint8_t | size, | ||
| uint8_t | opcode ) |
Send a generic command to the M6E Nano.
| dev | UART peripheral device. |
| command | Command to be sent. |
| size | Size of command. |
| opcode | Opcode to be packed. |
| void m6e_nano_set_antenna_port | ( | const struct device * | dev | ) |
Set the antenna port of the M6E Nano.
| dev | UART peripheral device. |
| void m6e_nano_set_baud | ( | const struct device * | dev, |
| long | baud_rate ) |
Set the baudrate of the M6E Nano.
| dev | UART peripheral device. |
| baud_rate | baudrate to set. |
| void m6e_nano_set_power_mode | ( | const struct device * | dev, |
| uint8_t | mode ) |
Set the power mode of the M6E Nano.
| dev | UART peripheral device. |
| mode | Power mode to set. See docs for valid modes. |
| void m6e_nano_set_read_power | ( | const struct device * | dev, |
| uint16_t | power ) |
Set the read power of the M6E Nano.
| dev | UART peripheral device. |
| power | Power to set. Between 0 and 27dBm. |
| void m6e_nano_set_region | ( | const struct device * | dev, |
| uint8_t | region ) |
Set the operating region of the M6E Nano. This controls the transmission frequency of the RFID reader.
| dev | UART peripheral device. |
| region | Operating region to set. |
| void m6e_nano_set_tag_protocol | ( | const struct device * | dev, |
| uint8_t | protocol ) |
Set the tag protocol of the M6E Nano.
| dev | UART peripheral device. |
| protocol | Tag protocol to set. |
| void m6e_nano_start_reading | ( | const struct device * | dev | ) |
Start a continuous read operation.
| dev | UART peripheral device. |
| void m6e_nano_stop_reading | ( | const struct device * | dev | ) |
Stop a continuous read operation.
| dev | UART peripheral device. |
| int user_send_command | ( | const struct device * | dev, |
| uint8_t * | command, | ||
| const uint8_t | length, | ||
| const bool | timeout ) |
Set the command to be transmitted by the UART peripheral.
| dev | UART peripheral device. |
| command | Command to be transmitted. |
| length | Length of the command. |
| timeout | Whether to wait for a response from the module. |